Sign in to follow this  
DickieChen

Creating REALISTIC lighing??

Recommended Posts

Hey everyone,
I have been learning directx for over 3months,and I'm still finding a lighing model that is true to nature,in fact,I had programmed an RPG game before,and I used D3DLIGHT with ShadowVolume to create lighting and shadow effect,
free image hosting
and the scene looks quite poor...just like CARTOON..
So I tried to use HLSL to create a vertex shader and make a better effect of the lighting..I got Diffuse,Ambient and Specular in my shader,and It worked,sarcastically,just as same as D3DLIGHT9
free image hosting
and it made me wonder..how these games,such as MonsterHunter,calculate lighting?Do they use a very nasty Shader? Or something else...
free image hosting

I tried many diffrent ways,in order to create realistic lighing,I tried PRT,when I found it's too slow,,and recently I found a interesting effect file,Hemisphere.fx in the SDK,and I'm still trying to use it in my game,though I don't have a very srong hope,
Do anyone knows how these games create lighing?I mean,just some clues..and that's really helpful to me....
thank you so much.

Share this post


Link to post
Share on other sites
One thing that can help a lot with realism is ambient occlusion, either real time with a shader, or precomputed into a lightmap.

There's a fairly good example of what you can expect from using lightmaps at: http://blogs.msdn.com/b/nicgrave/archive/2010/09/29/the-delights-of-dualtextureeffect.aspx

Share this post


Link to post
Share on other sites
The simple lighting model (that's implemented under the fixed-function pipeline for example) should be more than sufficient to create interesting and believable results.That's it,if you tweak the variables properly.

In my opinion,the thing that mostly destroys the realism in your picture is the ground.It looks like it has flat shading - i.e. you can't recognize from what direction the light is coming,because every pixel is lit with the same intensity.

Suggsetions to imporve this :
1) Subdivide the ground into many smaller quads(triangles).This will cause the light to be computed for every quad.In the event that you are using per-vertex lighting,this will greatly improve the quality of the image.
2) Use per-pixel lighting .
3) Use normal maps. For highly detailed surfaces,this will provide a cheap way to enchance the quality.
4) Do dynamic shadows for the character. This could be some form of shadow mapping or you could just project a shadow texture on the ground.
5) Do light mapping (as mentioned).Precompute a texture which contains high quality lighting information for the static objects (the castle comes to mind).

Share this post


Link to post
Share on other sites
THANK U SO MUCH INDEED!!
You open my eyes..and I'm now looking into articles about LIGHTMAP
http://www.flipcode.com/archives/Light_Mapping_Theory_and_Implementation.shtml
Although it's a little bit hard translating UV co-ordinates to world co-ordinates,but it's still so great!And I think I have more confidence than before!!

Thanks to both Adam_42 and ne0_kamen!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this