Jump to content
  • Advertisement
Sign in to follow this  
Kest

Compare Normal Lighting

This topic is 4352 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which of the three do you think looks better? Image Hosted by ImageShack.us Image Hosted by ImageShack.us All three use the same simple directional light. The left-most uses typical vertex normals. The right-most uses a 256x256 normal map. The middle uses a toned down 64x64 spherical environment map to fake specular lighting. The middle version's 'glow' can be adjusted from gone to pure white. The one seen here is modulated by RGB 64,64,64. I just started messing around with the idea of using spherical environment mapping to light objects. Has anyone ever tried this? It seems to have a much nicer effect than simple vertex normals. The cost is very small, considering every object in the game can use the same 64x64 texture. It doesn't give as much flexibility as a normal map (notice the toes on the background character?), but it's pretty cheap. What do you think?

Share this post


Link to post
Share on other sites
Advertisement
Personally,

I like the one in the middle best. Though, thats only because of the specular highlights. If you were to add that to the others, they may look equally good. So its hard to say which method is best, when each model has a different method applied... The normal map is nice, because it adds definition to the body, otherwise not seen in the other versions. I would like to see if you could get both the normal map/specular highlights working on that model, I think that would be the best looking. But, I haven't played around with spherical environment mapping, so I can't really help.

Have you done any benchmarks, I am just wondering how much faster the spherical mapping is for specular type effects, compared to just adding specular highlights.

Jeff.

Share this post


Link to post
Share on other sites
I haven't done any testing yet with specular lighting. I'm actually not even sure how it's normally done. I would really appreciate any general information about that. I do know that by using a spherical map, you have pretty much full control over the range of lighting. Here's a few examples.

From soft to intense using this map (actual size) and changing the modulated color:
Image Hosted by ImageShack.us

Free Image Hosting at www.ImageShack.usFree Image Hosting at www.ImageShack.us
Free Image Hosting at www.ImageShack.us

A solid wet-like look using this map:
Image Hosted by ImageShack.us

Free Image Hosting at www.ImageShack.us
Free Image Hosting at www.ImageShack.us

A cartoon-like effect with this one:
Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

I haven't tested performance with spherical mapping, but I doubt it will have much of an impact. The spherical texture used to light up the model looks identical in most situations, regardless of texture size (64x64 to 1024x1024).

Again, if anyone could give me a general explaination of how specular lighting is usually implemented, that would be really useful.

Share this post


Link to post
Share on other sites
Quote:
I just started messing around with the idea of using spherical environment mapping to light objects. Has anyone ever tried this? It seems to have a much nicer effect than simple vertex normals. The cost is very small, considering every object in the game can use the same 64x64 texture.

This is basically what we did back in the days of software rendering when it was too expensive to try and interpolate a normal vector at every pixel to get phong speculars. The main problem was that everybody always did it as if to have the speculars centered around the view direction, which isn't really correct (or rather, it's correct only in one particular case).

Generic specular lighting, you just use the average of the light vector and the view vector (both pointed in the direction leading from the surface) -- take the dot product between that and the normal vector, and raise it to some arbitrary power. The higher the power, the tighter the specular highlight. Though just doing that alone doesn't give you quite the same flexibility as a map insofar as getting things like the cartoony highlights and such. You can use partial dot products to lookup texture coordinates in the map, though -- but you do need to watch out for the fact that the variance curvature is different when you do that -- also a dot product only gives you one value, so your map becomes more of a color ramp palette than a spherical environment map.

Share this post


Link to post
Share on other sites
Quote:
Original post by cpiasminc
This is basically what we did back in the days of software rendering when it was too expensive to try and interpolate a normal vector at every pixel to get phong speculars. The main problem was that everybody always did it as if to have the speculars centered around the view direction, which isn't really correct (or rather, it's correct only in one particular case).

All that's needed is a state representing light rather than the camera. It seems a little odd to use a matrix to represent a light, but it's easy to construct such a thing in a vertex shader. A few cross products.

Quote:
Generic specular lighting, you just use the average of the light vector and the view vector (both pointed in the direction leading from the surface) -- take the dot product between that and the normal vector, and raise it to some arbitrary power. The higher the power, the tighter the specular highlight.

This has the problem with relying on the polygon shading technique (gouraud or such), which causes low-resolution meshes to look poor compared to high. Using a spherical map seems to help prevent that, making some of those low-res edges less obvious. Or at least I think it does. That's the one thing that attracted me to it. My examples didn't disable typical normal lighting while enabling the spherical lighting (maps need to define the whole range of light rather than the specular part of it). I will try to post an image of that soon.

Thanks much for explaining how that works.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!