Sign in to follow this  

Unreal engine 3 and specular map ?

This topic is 4847 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

Hi ! I looked at the unreal engine 3 tech demo. After being impressed, a few questions came to me: 1) What is behind specular mapping ? How does it work, how does we find specular map coord corresponding to the vertex\pixels ? Is it a 3D map ? 2)Same questions for normal mapping. 3)Does he use dot3 bump mapping ? They talk about virtual displacement mapping . What is it ? It's all. Keep up the work, gamedev is a great site ! :)

Share this post


Link to post
Share on other sites
1) Specular mapping: From my expirence with max, a specular map is a 2d grayscale bitmap specifying the intensity of the highlight across a polygon. eg: this bit of the polygon is more shiny than this other peice.
2) Normal mapping: Instead of having one normal per polygon, a new normal is calculated for each pixel/fragment. The each textel of the normal map specifies a normal which is combined with the TangentBinormalNormal matrix to get a new normal for that fragment (probably off, thats the next thing I need to implement)
3)Bump mapping: I believe the current trend is to replace bump mapping(most kinds) with normal mapping.
3.5)Virtual displacement mapping ie: Parallax mapping: Perturbes the diffuse texture coords to give the illusion of displacement mapping on a perpixel basis. However, the silhouette of the object remains the same. clicky

Share this post


Link to post
Share on other sites
For specular mapping, all you need to do is sample the greyscale specular map (or gloss map) at that position and scale the output specular value (so a black value in the gloss map will nullify out any specular at that point, and a while value in the gloss map will output the specular at full intensitiy). I usually use the alpha channel of the normal map as the gloss map.

Share this post


Link to post
Share on other sites
whats the exact difference between bumpmapping and normal mapping to its pretty much the same both are used to give a flat polygon the depth of a highpolygonal mesh

Share this post


Link to post
Share on other sites
A bumpmap actually is actually a hightmap, where the information of a depth of the pixels is stored. But a normal map is like a "per-pixel slope map" and doesn't really store depth information.

Share this post


Link to post
Share on other sites
*sighs* Lets not turn this into yet another "whats the difference between bumpmapping and normalmapping" thread.

Bumpmapping is basically any method that shows small scale surface perturbations. This can be done in several ways, of which, normalmapping is one ( also called dot3 bumpmapping ).

Quote:

A bumpmap actually is actually a hightmap, where the information of a depth of the pixels is stored. But a normal map is like a "per-pixel slope map" and doesn't really store depth information.


Not necessarily. A bumpmap is a texture that when used, gives the impression of small scale surface variations, how it does this is not important. Therefore, both heightmaps, and normalmaps can be considered "bumpmaps" when applied in the correct way.

Well, thats what I tend to think anyway...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I ask these questions even I known a little bit the subject because I wanted to discuss about it. Bump mapping, normal mapping, specular mapping are in the heart of the games like Doom3, Unreal engine 3 and the others. And *I\we\all* must be on top -_-"

Quote:
Original post by python_regious
*sighs* Lets not turn this into yet another "whats the difference between bumpmapping and normalmapping" thread.

Bumpmapping is basically any method that shows small scale surface perturbations.



Until here, i can be ok with you, but ...
sorry to engage a flame war.

Quote:
Original post by python_regious

This can be done in several ways, of which, normalmapping is one ( also called dot3 bumpmapping ).


For me, dot3 bumpmapping is a method wich use a normal perturbation of the surface. It's a phong shading except that in the last moment the normal of the surface\pixel is perturbed (using the bump map) and the dot product is finally do (dot3 for the 3Dimensions).
This is not the normal mapping. Normal mapping use the fact that the mapping (i.e correct perspective mapping) is dependant of the polygon plan\normal wich is mapped. In all ancient games like Quake1,2,3, the mapping is made using the polygon's normal, not the normal obtained by the phong\interpolation. If you use the interpolated normal, the mapping become unplanar for a (planar) polygon. Add to this a normal perturbation map (like in the dot3 bump), and you obtain the splendid material of Unreal engine 3 :)

The bump mapping do not change the map coordinate of a point\pixel\fragment. The normal mapping do it. This is the virtual displacement mapping. This is what I deduce with the aaron_ds post. Thank you, aaron_ds.

Quote:
Original post by cow_in_the_well

For specular mapping, all you need to do is sample the greyscale specular map (or gloss map) at that position and scale the output specular value (so a black value in the gloss map will nullify out any specular at that point, and a while value in the gloss map will output the specular at full intensitiy). I use usually use the alpha channel of the normal map as the gloss map.



What do you mean by sample the specular map at that position ? I tought about using a kind of spherical mapping to find the specular map coords...

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
sorry to engage a flame war.


You're not, don't worry.

Quote:

The bump mapping do not change the map coordinate of a point\pixel\fragment. The normal mapping do it. This is the virtual displacement mapping. This is what I deduce with the aaron_ds post. Thank you, aaron_ds.


Erm, sorry, but I think you're getting confused here. The virtual displacement mapping is either parallax mapping, or some variation on it, not normal mapping. Here is a paper on parallax mapping. I also have one at my home machine on a slightly different technique of virtual displacement mapping ( you get proper silluettes with it ), but alas I'm not there. Parallax mapping uses heightmaps, not normalmaps.

Also, aaron_ds is talking about dot3 bumpmapping to me. Using a normal map to encode perpixel normal information, to be used in lighting.

Most of the differences between bumpmapping and normalmapping is very subjective anyway, it's just a matter of opinion really.

Share this post


Link to post
Share on other sites
Thank you for the link !

Quote:
Original post by python_regious

Erm, sorry, but I think you're getting confused here. The virtual displacement mapping is either parallax mapping, or some variation on it, not normal mapping.


You are probably right. There is a lots of technics, and what I would have called normal mapping, was not called like this.

Share this post


Link to post
Share on other sites
Quote:
I also have one at my home machine on a slightly different technique of virtual displacement mapping ( you get proper silluettes with it )

mh? what's that technique called? (sorry if it has already been discussed on the forums, but I've been away without the net for 4 weeks, and I didn't yet have time to look through all that has been posted since :) )

Share this post


Link to post
Share on other sites
Quote:
Original post by sBibi
Quote:
I also have one at my home machine on a slightly different technique of virtual displacement mapping ( you get proper silluettes with it )

mh? what's that technique called? (sorry if it has already been discussed on the forums, but I've been away without the net for 4 weeks, and I didn't yet have time to look through all that has been posted since :) )


I can't remember, I'll be getting home from my parents on Tuesday, so I'll post it here then.

Share this post


Link to post
Share on other sites
Quote:
Original post by sBibi
Quote:
I also have one at my home machine on a slightly different technique of virtual displacement mapping ( you get proper silluettes with it )

mh? what's that technique called? (sorry if it has already been discussed on the forums, but I've been away without the net for 4 weeks, and I didn't yet have time to look through all that has been posted since :) )


*real* displacement mapping get proper silluettes. It change the mesh in function of the diffuse map. (If someone is not ok with that please, say it ;))

Share this post


Link to post
Share on other sites
Quote:
*real* displacement mapping get proper silluettes. It change the mesh in function of the diffuse map. (If someone is not ok with that please, say it ;))

he talked about _virtual_ displacement mapping here :)
and erm... the diffuse map is used for.. the diffuse term, not displacement :D you probably meant the displacement map.

Quote:
I can't remember, I'll be getting home from my parents on Tuesday, so I'll post it here then.

OK, thanks! :)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You could modify the depth of each pixel in the fragment shader based on the height map to get real displacement per pixel. Not tested this, but it should work.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
You could modify the depth of each pixel in the fragment shader based on the height map to get real displacement per pixel. Not tested this, but it should work.


I can see that messing up early Z rejection, nice idea though...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What do you mean by messing up early z rejection? Early z reject will be disabled if the fragment z is being modified.

http://www.delphi3d.net/ has a demo doing z-correct parallax mapping and horizon mapping. But the fragment level z displacement is an approximation which still does not fix the silhouette problem.. it makes intersections look better though.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Early z reject will be disabled if the fragment z is being modified.


Thats what I meant. Since you'd be doing this on most surfaces aswell in a level, you're basically rendering without early z reject, which'll put a big dent in your performance. Of course, I'm not talking from experience, because I haven't tried it, but I can imagine it hurting performance rather badly.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
What do you mean by messing up early z rejection? Early z reject will be disabled if the fragment z is being modified.

http://www.delphi3d.net/ has a demo doing z-correct parallax mapping and horizon mapping. But the fragment level z displacement is an approximation which still does not fix the silhouette problem.. it makes intersections look better though.


Well it makes it look better on pictures..
when moving however, it looks horrible..

Share this post


Link to post
Share on other sites
Quote:
Original post by LogicalError
Quote:
Original post by Anonymous Poster
What do you mean by messing up early z rejection? Early z reject will be disabled if the fragment z is being modified.

http://www.delphi3d.net/ has a demo doing z-correct parallax mapping and horizon mapping. But the fragment level z displacement is an approximation which still does not fix the silhouette problem.. it makes intersections look better though.


Well it makes it look better on pictures..
when moving however, it looks horrible..


Why ? You have test it ? Is it due to the z test's precision near intersections ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Woodchuck
Why ? You have test it ? Is it due to the z test's precision near intersections ?


Quote:
Original post by Anonymous Poster
http://www.delphi3d.net/ has a demo doing z-correct parallax mapping and horizon mapping.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by LogicalError
Quote:
Original post by Woodchuck
Why ? You have test it ? Is it due to the z test's precision near intersections ?


Quote:
Original post by Anonymous Poster
http://www.delphi3d.net/ has a demo doing z-correct parallax mapping and horizon mapping.


It seems I'm not able to following you when i'm tired and hurry. Sorry for the inconvenients and thanks to answer my posts. Note that i'm still studying english and then it's hard to integrate the whole information in a single reading.


Quote:
Original post by python_regious
View Dependant Displacement Mapping.


Very interresting things. The most important for me is how they compute the silluettes (the self-shadowing is elegant too). In front of that, I don't like hight-dimensional maps. It is possible to pre-compute all things with XXL-Dimension spaces.
Last things, does the sampling of the viewing direction not involve visible artifacts ? A demo would have been welcome. Personally, I think not, but...

Share this post


Link to post
Share on other sites

This topic is 4847 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.

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