Game Engine Forum - Grit Open Source Streaming Game Engine
Site Header
It is currently Fri Oct 20, 2017 8:57 am

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Additional Libraries and Functionalities
PostPosted: Tue May 13, 2014 4:52 am 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
Hi Grit community,

this is my first topic, so, i have to say that i love this engine :Aw: :heart:

so, i know that Grit still on development and have a nice roadmap with nice functionalities to be a awesome engine like GTA V engine, but my question is if Grit, on the future, will use any of these libraries or functionalities that i think that is very important for a game engine:

- Decals:

Image

http://www.ogre3d.org/forums/viewtopic.php?f=11&t=72683

easy to use decal system, a usefull library (Crysis 1 without decals is a poor graphics game ;) )

- Mesh navigation system (for AI, pathfinding)

Recast and Detour:

Image

https://github.com/duststorm/OgreCrowd
video: https://www.youtube.com/watch?v=gYnfWx4cBEs

really usefull and necessary i think, and i can have a large fun time killing bots if this will be implemented ond Grit (+ enet system this will be a awesome mutiplayer game, better than GMOD :D )

ZLib license (UE4 uses this library too, i think)

- Lensflare system:

Image

http://www.ogre3d.org/forums/viewtopic.php?f=11&t=65630

just a tiny library for lensflare system

- Smartbody (locomotion system, etc.)

Image

http://sourceforge.net/projects/smartbody/
video: http://smartbody.ict.usc.edu/HTML/video ... motion.mp4

this library reminds me gta locomotion system, but i don't know if it's really usefull, i think that is a little bit difficult to implement on Grit, but would be interesting

And finally other question, is there any way to use a per-object environment cube map? (to simulate realtime global illumination rendering a ex. 16px cube map each second for individually object, using gfx_bake_env_cube() and applying for a specific scene object )

Sorry for my terrible english, it's my first time

Thank you for replies, see you soon 8-)


Last edited by Augusto Moura on Wed May 21, 2014 7:43 pm, edited 5 times in total.

Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Mon May 19, 2014 7:30 am 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
You should already be able to do lensflare using the HUD system (since that's a 2d overlay). It won't be HDR though, but I doubt HDR is necessary.

My plan for decals is to make use of the deferred shading depth buffer and project them using cube draws. This is a pretty standard technique and shouldn't be hard to implement. It is also related to using projected lighting, e.g. for the special shape of car headlights.

Navigation has been talked about before, using an existing system looks like the way forward at this point. Whether or not the mesh should be laid out by artist or inferred is a difficult question.

Smart body looks cool, never seen that before.

There won't be support for a per object environment map, but it will support zones, i.e. a given room or cave or tunnel etc can have its own environment map, which will be used to light objects in that space. This is necessary so you can move the objects around.


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Mon May 19, 2014 6:55 pm 
Offline
Newbie

Joined: Fri Jul 26, 2013 5:30 am
Posts: 139
http://sourceforge.net/projects/smartbody/


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Thu May 22, 2014 7:30 am 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
very interesting, nice point about all

thanks for reply :)


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Wed May 28, 2014 5:51 am 
Offline
Newbie

Joined: Mon May 05, 2014 8:20 pm
Posts: 5
Hey, Spark, how much of OGRE does Grit actually use and how modified is it?


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Fri May 30, 2014 5:11 pm 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
http://www.gritengine.com/game-engine-wiki/Ogre+Usage


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Tue Jun 03, 2014 11:15 pm 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
That list was out of date, we are no-longer using Ogre::Entity :)


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Wed Jun 25, 2014 5:11 pm 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
Just a update on my lens flare (have many glitches yet) :P



Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Fri Jun 27, 2014 5:52 pm 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
Almost done..

[updated, I forgot many things before]



if anyone interested, you can download it here:



and

On gfx.cpp add this: (to get a vec2() screen position based on a vector3() world position)
Code:
Vector2 screenSpaceCoords(const Vector3& mPoint)
{
   //a simple conversion from Vector3 to Ogre::Vector3, because Ogre::Matrix4..
   Ogre::Vector3 mp;
   mp.x = mPoint.x;
   mp.y = mPoint.y;
   mp.z = mPoint.z;

   Ogre::Vector3 point = eye_left->getCamera()->getProjectionMatrix() * (eye_left->getCamera()->getViewMatrix() * mp);

   int resx = ogre_win->getWidth();
   int resy = ogre_win->getHeight();

   Vector2 screenSpacePoint = Vector2(0, 0);
   screenSpacePoint.x = (point.x / 2.f) * resx;
   screenSpacePoint.y = (point.y / 2.f) * resy;

   return screenSpacePoint;
}

bool isVisible(const Vector3& point)
{
   //a simple conversion from Vector3 to Ogre::Vector3
   Ogre::Vector3 mp;
   mp.x = point.x;
   mp.y = point.y;
   mp.z = point.z;
   return eye_left->getCamera()->isVisible(mp);

}


on gfx.h add before #endif:
Code:
Vector2 screenSpaceCoords(const Vector3& iPoint);

bool isVisible(const Vector3& point);


on lua_wrappers_gfx.cpp add: (for lua acess)
Code:
static int global_get_screen_space_coords(lua_State *L)
{
TRY_START
        check_args(L,1);
   Vector3 v = check_v3(L, 1);

   push_v2(L, screenSpaceCoords(v));
        return 1;
TRY_END
}
static int global_is_visible(lua_State *L)
{
   TRY_START
   check_args(L, 1);
   Vector3 v = check_v3(L, 1);

   lua_pushboolean(L, isVisible(v));
   return 1;
   TRY_END
}


and inside of "static const luaL_reg global[] = {"
add:
Code:
{"getScreenSpaceCoords", global_get_screen_space_coords},
{ "isVisible", global_is_visible },


on Grit, to add the lens flare:
Code:
include '/lensflare/LensFlare.lua'

gfx_hud_object_add('/lensflare/LensFlare', { parent=hud_center,  position=vec2(0, 0)})


but the occlusion function it's not ready yet (the code have a not working 'physics_sweep_sphere' try), anyone know how to do something like this? (mesh or alpha based textures on map can fade smoothly the lens flare)



Last edited by Augusto Moura on Tue Jul 01, 2014 4:53 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Sat Jun 28, 2014 10:26 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 2:13 pm
Posts: 318
Location: Spain
That Lens flare look really nice! Will this be on the SVN?

_________________
oh yeahh


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Sun Jul 06, 2014 11:22 pm 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
That looks pretty cool, you should indeed be able to use the cast sphere function to test if the sun is visible. It won't know about particles (smoke) or other things that don't have a physics representation though. I don't know how other games handle that case (probably via hacks).


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Sun Jul 06, 2014 11:25 pm 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
Just watched the video, my guess is they are testing the depth buffer at the point of the sun to see if there is any occlusion. That's not possible in Grit right now. I'd probably want to expose it as a specific function is_sun_occluded or such.


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Sun Jul 06, 2014 11:26 pm 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
That won't work with things that don't write to the depth buffer though, like complex alpha calls. But there are ways of fixing that as well.


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Wed Jul 09, 2014 5:54 pm 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
Interesting :)


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Tue Aug 12, 2014 7:54 am 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
Sorry for the delay, I added this script in with a few changes:

1) fixed the "1 frame behind" problem by passing in the next frame's camera parameters instead of using the last frame's ones from the ogre camera

2) return z as well as x, y, and use z to determine whether we are in front of the camera or not

3) some simple refactorings and changes so that the coding style is consistent


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Tue Aug 12, 2014 7:58 am 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
A couple of additional comments -- the textures are a bit bold, may want to tone them down a bit. They're also a bit large. But the actual positioning of the objects on screen seems to work pretty well. Nice job.


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Wed Aug 13, 2014 2:58 am 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
Great, all works fine now :D

I just made a tiny fix on lensflare code like parent on hud_center and decrease texture resolution, but I will redraw the textures and add more cool effects soon :)


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Wed Aug 13, 2014 3:34 am 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 769
Actually I changed the output of the screen coordinates to be centered on the bottom left, for consistency with existing APIs which are centered on the bottom left. Shouldn't that mean that it's no-longer centered on the sun anymore?

Apologies for not mentioning that in the last post. I completely forgot I did it :)


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Thu Aug 14, 2014 6:14 am 
Offline
Newbie
User avatar

Joined: Fri Mar 21, 2014 12:25 am
Posts: 114
Location: Rio Grande do Sul
Yes, only in this case should be centered, so I already fix this on lua, no problem :)


Top
 Profile  
 
 Post subject: Re: Additional Libraries and Functionalities
PostPosted: Sun Aug 17, 2014 3:12 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 10:06 am
Posts: 440
How do I remove or disable the lens flare? It is very distracting and I don't like camera-style rendering tricks and prefer what the eye can see over a camera.

It's cool and all for people who like it, and I respect the work put in, and Spark told me it is some pretty complex work, but I cannot really stand it in any game, I pretty much agree with this:

http://www.gamesradar.com/brief-history ... ens-flare/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Localized by Maël Soucaze © 2010 phpBB.fr