Combining Lesson 34 with parallax mapping

Started by
-1 comments, last by DeathwishCRO 14 years ago
Greetings, with the help from lc_overlord I've added texturing to the heightmap tutorial. Now I would like to add the parralax maping to the same code. I have found and example of parralax mapping here http://www.codesampler.com/usersrc/usersrc_5.htm Now I succesfully added the variables and functions from the parallax project to Nehes tutorial but am havin some trouble makin it work. I have tried adding the texture initialization to the RenderHeightmap function where the texturing went on before. However the result is not very satisfying and quite slow. I am not sure where to best place the folowing segment of code glUseProgramObjectARB( g_programObj ); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, g_textureID); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, g_heightMapID); glActiveTexture(GL_TEXTURE0); setShaderConstants(); glInterleavedArrays( GL_T2F_C3F_V3F, 0, g_quadVertices ); glDrawArrays( GL_QUADS, 0, 4 ); glUseProgramObjectARB( NULL ); which is in the render function of the original tutorial. My project is here http://www.megaupload.com/?d=AADG2YQZ If anybody has any ideas I would be gratefull, now i need to get some shuteye :) p.s the heightmap terrain is the other .raw file in the data folder, Im curently testing it ona a flat terrain

This topic is closed to new replies.

Advertisement