Jump to content
  • Advertisement

1Bad

Member
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

122 Neutral

About 1Bad

  • Rank
    Member
  1. 1Bad

    convert char* to LPCWSTR

    You want to use "wchar_t" instead of "char" if you need a LPCWSTR. LPCWSTR is a pointer to a wide char array (Long Pointer to Const Wide String). You can also change your project to not use Unicode or use _TCHAR instead of "char" which will automatically become "wchar_t" if unicode is defined and "char" if unicode is not defined.
  2. ooooohhhh! now I see. That makes perfect sense. Thank you both :).
  3. Hello, I wish to understand how to compute tangents for a given mesh to render normal mapped objects, however, in most references to tangent computation, there is math that involves grabbing texture coordinate information. I believe that I understand how to calculate a tangent but I do not understand why some calculations involve UV's in their calculations. Perhaps someone can clear this up for me.
  4. Hey all, I am wondering if Quad-edge http://en.wikipedia.org/wiki/Quad-edge, is a good method for storing and managing adjacency information for realtime rendering of terrain meshes? It seems like it would be effective but am unsure of other options, so please feel free to share any other data structures.
  5. 1Bad

    Display list

    how many display lists are you using? if you are calling alot of display lists vs. making 1 call, the overhead of making a bunch of calls could make ur performance worse.
  6. 1Bad

    VBO Altering

    So this would require some multithreading to make double buffering efficient. From what I have read using mapping the buffer means that the entire buffer needs to be recopied onto the card after unmap is called. Is the speed of this transfer such that it would not noticably effect performance if I wanted to make incremental changes to a very large buffer?
  7. Hey, so I am considering various options for storing an rendering planetary terrain. One way which I have considered is storing all the vertices in one VBO and using the glMapBuffer() function to incrementally add and remove vertices from the buffer as I need them. However, I am unsure of the performance of the glMapBuffer function. I wish to only update specific vertecies in the buffer, I know the index and all. I do not want to have to update the entire buffer or have to transfer the entire buffer from graphics memory to system memory either to make this alteration. What are the choices I have when I want to modify a large buffer and make only small alterations to it in an efficient manner?
  8. 1Bad

    Deferred Shading Strange issues

    what happens if you output only the specular every frame? Will it always show up or does the screen go black? You probably already figured this out but it appears that for the first frame (emission + ambient + diffuse)*colorr = 0 and for the rest specular = 0... I am not familiar with ur lighting model but why do you add specular after your add and multiply by the rest? wont this give specular a small effect on the total output?
  9. 1Bad

    VBO Question

    thanks alot you two :) Sometimes I miss the little things like that :P
  10. 1Bad

    VBO Question

    I didn't know about the ARB ones, I just read them out of my OpenGL book. Are those the only 2 that are different? I am looking in glext and don't see ARB macros for normals and Texture coords.
  11. Hey, I have read alot about implementing VBO's but I have been unable to resolve a problem I am having. So I got my code working with vertex arrays and glDrawElements. Additionally, I have been able to store my polygon data, using an "GL_ELEMENT_ARRAY_BUFFER" and the vertex data is still being accessed through vertex arrays. However, when I attempt to render the vertex arrays using buffer objects I get access violations. Here is a sample of my code, perhaps you can see if I made a stupid mistake somewhere. Building VBO's: glGenBuffersARB(1,&id_PolyBO); glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, id_PolyBO ); glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)*cmpPolySize, cmpPoly, GL_STATIC_DRAW_ARB ); glGenBuffersARB(1,&id_VertBO); glBindBufferARB( GL_VERTEX_ARRAY, id_VertBO ); glBufferDataARB( GL_VERTEX_ARRAY, sizeof(GLfloat)*cmpVertSize, cmpVert, GL_STATIC_DRAW_ARB); glGenBuffersARB(1,&id_MapCoordBO); glBindBufferARB( GL_TEXTURE_COORD_ARRAY, id_MapCoordBO ); glBufferDataARB( GL_TEXTURE_COORD_ARRAY, sizeof(GLfloat)*cmpMapCoordSize, cmpMapCoord, GL_STATIC_DRAW_ARB); glGenBuffersARB(1,&id_NormBO); glBindBufferARB( GL_NORMAL_ARRAY, id_NormBO ); glBufferDataARB( GL_NORMAL_ARRAY, sizeof(GLfloat)*cmpNormSize, cmpNorm, GL_STATIC_DRAW_ARB); Rendering using VBO's: glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glBindBufferARB( GL_VERTEX_ARRAY, id_VertBO ); glVertexPointer( 3, GL_FLOAT, 0, static_cast< void * >(/*cmpVert*/0) ); / glBindBufferARB( GL_TEXTURE_COORD_ARRAY, id_MapCoordBO ); glTexCoordPointer( 2, GL_FLOAT, 0, static_cast< void * >(/*cmpMapCoord*/0)); glBindBufferARB( GL_NORMAL_ARRAY, id_NormBO ); glNormalPointer( GL_FLOAT, 0, static_cast< void * >(/*cmpNorm*/0)); glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, id_PolyBO ); glDrawElements(GL_TRIANGLES, cmpPolySize, GL_UNSIGNED_INT , static_cast< void *>(/*cmpPoly*/0)); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_NORMAL_ARRAY);
  12. 1Bad

    Terrain LOD

    thanks for the great resource :)
  13. Hey all, I am trying to figure out a good way to generate terrain from a heightmap where the flat portions of the terrain use less polygons, and the bumpy portions are made up of more polygons. The technique I tried created T-Junctions which I hear are bad because they can cause artifacts. Are there any links or books you can point me towards to help me with this problem, and any good books on terrain in general?
  14. I figured it out. It was a problem in how I found the texture index in an array. the correct way to find the index in the array is actually (mapcoordy*texturewidth) + mapcoordx So to get to the ycoord u need to pass over y*the width of the texture to get to the correct row.
  15. It seems my problem is more that I seem to be getting bogus values. After applying the heightmap function my terrain looks totally random and nothing like the height map. Is there something I need to consider when trying to turn UV coords into array indices that I am missing?
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!