How to have an uniform sunlight ?
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
How to have an uniform sunlight ?
Hi,
I have a problem with my sunlight. I created a directionnal light with direction of Sun. Well but my character is lighted as one edge (the edge in front of the sun) and he is totally black when i turn camera around him. I'd like to have a light more uniform as realife. But How ? How many light I've to create for exemple ?
++
I have a problem with my sunlight. I created a directionnal light with direction of Sun. Well but my character is lighted as one edge (the edge in front of the sun) and he is totally black when i turn camera around him. I'd like to have a light more uniform as realife. But How ? How many light I've to create for exemple ?
++
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: How to have an uniform sunlight ?
Use an ambient light, SceneManager::setAmbientLight.
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
Re: How to have an uniform sunlight ?
ok but with an ambiant light my terrain and my character is lighted but there is no detail, for exemple my character is totally pink we can't see details as muscles, textures, etc...
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
Re: How to have an uniform sunlight ?
Try to boost your emissive light (self-lighting)
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: How to have an uniform sunlight ?
Valve uses a technique called half lambert. (You need a shader for it)
You do the standard lambert lighting algorithm (normal dot dirToLight), but then multiply the result by 0.5, add 0.5 and square it. This turns a 1 to -1 range into a 1 to 0 range. The light will wrap around to the back.
It's fake, but is a cheap way to simulate global lighting.
https://developer.valvesoftware.com/wiki/Half_Lambert
You do the standard lambert lighting algorithm (normal dot dirToLight), but then multiply the result by 0.5, add 0.5 and square it. This turns a 1 to -1 range into a 1 to 0 range. The light will wrap around to the back.
It's fake, but is a cheap way to simulate global lighting.
https://developer.valvesoftware.com/wiki/Half_Lambert
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
Re: How to have an uniform sunlight ?
I try with emissive light but it is very ugly.syedhs wrote:Try to boost your emissive light (self-lighting)
with emissive 0.3 0.3 0.3
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: How to have an uniform sunlight ?
Your character doesn't appear to have textures.
If you want it to look less flat, you'll either need to texture it or use more sophisticated shading techniques, e.g. an ambient occlusion compositor.
If you want it to look less flat, you'll either need to texture it or use more sophisticated shading techniques, e.g. an ambient occlusion compositor.
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
Re: How to have an uniform sunlight ?
I'd tried compositor SSAO but I don't know how to make it work.
I try
Ogre::CompositorManager::getSingleton().addCompositor(mCameraBack->mCamera->getViewport(), "SSAO/GBuffer");
Ogre::CompositorManager::getSingleton().setCompositorEnabled(mCameraBack->mCamera->getViewport(), "SSAO/GBuffer", true);
but my screen is totally black
I try
Ogre::CompositorManager::getSingleton().addCompositor(mCameraBack->mCamera->getViewport(), "SSAO/GBuffer");
Ogre::CompositorManager::getSingleton().setCompositorEnabled(mCameraBack->mCamera->getViewport(), "SSAO/GBuffer", true);
but my screen is totally black
Last edited by dragonblood on Mon Aug 17, 2015 11:45 pm, edited 2 times in total.
-
- OGRE Expert User
- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 168
Re: How to have an uniform sunlight ?
If I remember correclty for those ssao effects you need to add various compositors, GBuffer, Crytek and Modulate (I think)
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
Re: How to have an uniform sunlight ?
When I add GBuffer my screen become black.
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
Re: How to have an uniform sunlight ?
I think you just need a texture for the character.. the last image looks ok but it doesn't have texture.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
Re: How to have an uniform sunlight ?
ok but how can I Texture it ? I'm not a graphist and this is a high poly model (7000 poly). I use Maya. How can i create texture easily ?syedhs wrote:I think you just need a texture for the character.. the last image looks ok but it doesn't have texture.
-
- Halfling
- Posts: 68
- Joined: Sat Apr 25, 2015 4:01 pm
- x 6
Re: How to have an uniform sunlight ?
OK i used Simple SSSAO from here http://www.ogre3d.org/tikiwiki/tiki-ind ... imple+SSAO
It works !! But my mesh is too dark and when i add Ambiant or emissive there is no effect on my mesh.
It works !! But my mesh is too dark and when i add Ambiant or emissive there is no effect on my mesh.