Advertisement Jump to content
Sign in to follow this  

[GLSL]is it possible of making parallax bump mapping without multipass ?

This topic is 4920 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 don't manage to find how make this in a single pass, do you know how ? Otherwise where can i find documentation about multipass rendering and how rendre to a texture ?

Share this post

Link to post
Share on other sites
Original post by TheSeb
sorry, "the current shader" ?

He means your basic bump mapping shader. Parallax mapping (essentially a texture distortion effect) is an extension to standard DOT3 based bump mapping, which will only modulate the pixel colour on its own.

You start by writing a standard DOT3 pixelshader, and add a few lines to get the parallax effect on the texture UVs.

Share this post

Link to post
Share on other sites
it is from the documentation above. Somebody can explain me what is the bias here ? :

"To compute a texture coordinate offset at a point P, the eye vector must first be normalized
to produce a normalized eye vector V. The height h at the original texture coordinate To is
read from the height map. The height is scaled by a scale factor s and biased by a bias b in
order to map the height from the range {0.0, 1.0} to a range that better represents the
physical properties of the surface being simulated. For example, a brick wall texture might
cover a 2x2 meter area. Also imagine the surface of the bricks and the recessed grout give
the surface a thickness of 0.02m. The correct scale factor for this material would be 0.02 /
2 = 0.01. Coupling this with a bias of 0.0 would then remap the height field to a range of
{0.0, 0.01}. Using a bias of ­0.01
would remap the range to {­0.99,
0.0}. The average of
these two extremes is probably best for most textures.
b = s ∙ ­0.5"

Share this post

Link to post
Share on other sites
In Greek mythology, Bias was a brother of Melampus who received one third of Argos (see Melampus for more information). Bias married Pero. He was the father of Talaus with Pero. :)

But really bias = offset, I think :)

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!