DeathwishCRO

Members
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

100 Neutral

About DeathwishCRO

  • Rank
    Newbie
  1. Greetings, I am having some trouble with the following example from codesampler.com http://www.codesampler.com/source_users/oglu_glslang_relief_mapping.zip It compiles alright but... I get a vertex & fragment shaders failed to link message , I do not get this message on my laptop (x700 radeon winxp sp3) but its so slow my system clogs, how ever on my pc (x2 5000, radeon 4670 xp sp2, latest drivers)I get this linking error. any ideas why ?, I googled a bit and there was mention of a problem with a GL variable type
  2. 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
  3. Lesson 34 adding textures to the terrain

    Works fine, thank you very much. Totaly forgot bout the setvertex function Best regards, Daniel
  4. Lesson 34 adding textures to the terrain

    Thank you for your reply, however Im wondering if the height of the heigthmaped terrain does not influence the texturing? I've added the functions from the texturing tutorial,and enabled texturing in glinit I've modified the renderheightmap function like so void RenderHeightMap(BYTE pHeightMap[]) // This Renders The Height Map As Quads { glBindTexture(GL_TEXTURE_2D, texture[0]); // Select Our Texture NEW int X = 0, Y = 0; // Create Some Variables To Walk The Array With. int x, y, z; // Create Some Variables For Readability if(!pHeightMap) return; // Make Sure Our Height Data Is Valid if(bRender) // What We Want To Render glBegin( GL_QUADS ); // Render Polygons else glBegin( GL_LINES ); // Render Lines Instead for ( X = 0; X < (MAP_SIZE-STEP_SIZE); X += STEP_SIZE ) for ( Y = 0; Y < (MAP_SIZE-STEP_SIZE); Y += STEP_SIZE ) { // Get The (X, Y, Z) Value For The Bottom Left Vertex x = X; y = Height(pHeightMap, X, Y ); z = Y; // Set The Color Value Of The Current Vertex SetVertexColor(pHeightMap, x, z); glTexCoord2f((float)x*(1/MAP_SIZE),(float)y*(1/MAP_SIZE)); glVertex3i(x, y, z); // Send This Vertex To OpenGL To Be Rendered (Integer Points Are Faster) // Get The (X, Y, Z) Value For The Top Left Vertex x = X; y = Height(pHeightMap, X, Y + STEP_SIZE ); z = Y + STEP_SIZE ; // Set The Color Value Of The Current Vertex SetVertexColor(pHeightMap, x, z); glTexCoord2f((float)x*(1/MAP_SIZE),(float)y*(1/MAP_SIZE)); glVertex3i(x, y, z); // Send This Vertex To OpenGL To Be Rendered // Get The (X, Y, Z) Value For The Top Right Vertex x = X + STEP_SIZE; y = Height(pHeightMap, X + STEP_SIZE, Y + STEP_SIZE ); z = Y + STEP_SIZE ; // Set The Color Value Of The Current Vertex SetVertexColor(pHeightMap, x, z); glTexCoord2f((float)x*(1/MAP_SIZE),(float)y*(1/MAP_SIZE)); glVertex3i(x, y, z); // Send This Vertex To OpenGL To Be Rendered // Get The (X, Y, Z) Value For The Bottom Right Vertex x = X + STEP_SIZE; y = Height(pHeightMap, X + STEP_SIZE, Y ); z = Y; // Set The Color Value Of The Current Vertex SetVertexColor(pHeightMap, x, z); glTexCoord2f((float)x*(1/MAP_SIZE),(float)y*(1/MAP_SIZE)); glVertex3i(x, y, z); // Send This Vertex To OpenGL To Be Rendered } glEnd(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Reset The Color } It all compiles normaly but no texture is shown :/ Here is my solution folder if it helps show you where am i Blundering http://rapidshare.com/files/372982652/NEHE_Lesson34_heightmap_loading.7z.html best regards
  5. Greetings all, I'm quite new to open gl (I've done some OSG, delta 3d coding), so i was wondering how to add a texture to the terrain so it looks more realistic. I've gone through the texturing tutorial on NeHe but had no success so far. I understand that i need to setup the texture similar to the seting up on the faces of poligons, (top/bottom- left/right), but am not sure how exactly to do so? Any help would be appreciated