Jump to content
  • Advertisement
Sign in to follow this  
DG756

Shaders and glOrth/gluPerspective

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

I've implemented relief mapping using shaders I found online and whilst it works fine for the set up the code has, I need to change it, and this causes weird artefacts.

At the moment the example is using gluPerspective and is using the following values to send to the vertex shader

[SOURCE]
GLint loc_eyePos = glGetUniformLocation(p, "Eye");
GLint loc_tangent = glGetUniformLocation(p, "Tangent");
GLint loc_normal = glGetUniformLocation(p, "Normal");
GLint loc_binormal = glGetUniformLocation(p, "BiNormal");

glUniform4f(loc_eyePos, 0.0f, 0.0f, 0.0f, 1.0f);


glUniform4f(loc_tangent, 1.0f, 0.0f, 0.0f, 0.0f);
glUniform4f(loc_normal, 0.0f, 0.0f, 1.0f, 0.0f);
glUniform4f(loc_binormal, 0.0f, 1.0f, 0.0f, 0.0f);
[/SOURCE]


However I am mapping textures onto a pyramid and thus need to use glOrtho to preserve how the geometrical model looks in the texture-model. However when I change it to glOrtho it doesn't look right and gives weird artefacts.

I am unsure but I think it may have something to do with the above vector values since the example said that "they are specific to the example".

Does anyone have any ideas?

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!