Why would parallax mapping be dependent on the light source direction? All the examples I have looked at tie it in with the light source.
I am using “radiosity bump mapping” which is a fancy way of saying I calculate a lightmap with a “light direction map” to tell the shader where light is coming from.
I don’t see why parallax mapping needs to be tied to a light source, since it is a function of the eye vector and the height at that texel.
I have bumpmapping implemented. It works perfectly, but it doesn’t use a single light source like most examples do.
Now parallax mapping simply takes the normal and the eye vector and skews the texcoords a little. So I want to do this independently of the bumpmapping or lighting.
Given one of his constants is called “halfvec”, I suppose he’s using the half vector between the eye vector and the light direction, hence the original question
Exactly. Every implementation I have seen uses a halfvec from a light source. They are probably merging some of their bumpmap / parallax mapping stuff, but there should be a way to do them separately. I mean, you should be able to do parallax mapping on a flat unlit texture with no bumpmap, just a heightmap.
We would need to see the code.
In the case of parallax mapping, the halfvec variable would need to be based on the polygon’s normal. It shouldn’t be based on light, I agree. The new texture coordinate shouldn’t be relative to the position of a light source. (Or the half-vector between them) That would cause the coordinate offset to move depending on your position relative to a light source.
The important part is the parallax mapping section at the beginning, where basetexcoord is calculated. I am storing the heightmap in the colormap alpha channel (bumpmap alpha already gets used for specular level).
Thanks to Arne Reiners for his help with some of the bump stuff.
Originally posted by CRasterImage:
Well, I have a Geforce 6000-something and I can’t get it to render faster than 90 frames per second, if I don’t draw anything at all.
Vsync on?
Switch the 3D settings in the NVIDIA display control panel for “vertical sysnc” to “force off” and remeasure.