Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About regnar

  • Rank

Personal Information

  • Interests
  1. I wanted to use technique where you have one small vertex buffer to render all your terrain patches by modifying the vertices in vertex shader depending on world location and LOD of the patch. It seemed very efficient thing to do at first but now it makes me wonder if the hustle with sending data back to CPU is worth it.
  2. Hi! I've been trying to implement simple virtual globe rendering system using "3D Engine Design for Virtual Globes" book as a reference. What I do is I use 6 planes to form a cube, send it to GPU and use vertex shader to form a sphere and add random noise to simulate surface of the planet. The problem is how do I do CPU work on the vertex data from now on - how do I get world space coordinates of a terrain patch to perform LOD techniques, how do I do camera-terrain collision detection etc. ?
  3. Hello! I have done programming my game and now it is time for artwork. And what I want is to create my own style of graphics and than fit all my models and interface elements into that style. Like when you look at any World of Warcraft screenshot and you already can tell the game it is from only looking at one or two objects. But I have no idea how to achieve this. I googled and couldn't find anything. If somebody could provide me with some links or keywords to google for it would be awesome.
  4. Thank, V-man. I enabled glEnable(GL_COLOR_MATERIAL) and now it works!
  5. I am using glColorPointer(4, GL_UNSIGNED_BYTE,..,..), no material. Yes, I am using diffuse lighting. That is the reason i didn 't use GL_DECAL on texture stage 0, becouse all shading gets covered by first texture. (but it didn 't work with GL_DECAL either).
  6. Thanks for quick reply, but unfortunately it is not working. Now it just shows texture from stage 0, no matter what vertex alpha is set.
  7. Hi! I have a mesh with different alpha values for vertices. I also have 2 textures. What I want is to show "texture 1" when vertex alpha is 0, and show "texture 2" when vertex alpha is 1. Closest thing I managed to get is show "texture 1" when vertex color is white, and show "texture 2" when vertex color is black. [Opengl ES] glActiveTexture(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, tTexture[1]); glActiveTexture(GL_TEXTURE1); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, tTexture[0]); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE); glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_PRIMARY_COLOR); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR); I feel that I somehow need to pass vertex alpha as third argument to achieve what i want. But how do I do that?
  8. Quote:Original post by mhagain it's perfectly possible to create a GL_UNSIGNED_SHORT buffer with more than 65536 elements No, no, the problem was that you can only index vertices from 0-65535, because of unsigned short data type limit. And glDrawRangeElements unfortunately is not supported.
  9. Could be an option, but you can not pass index data to glDrawArrays, only vertex data. In case anyone else has this problem, I've searched the web and found that usually it is recommended to create multiple vertex buffers with no more than 65 536 vertices per buffer. Other option could be to use one large vertex buffer, but to separate data into multiple index buffers, where you index no more than 65 536 vertices per buffer. And then, when rendering, just use different parts of that vertexbuffer by shifting pointer to "first" vertex (using glVertexPointer). For example: vertex buffer: [v1,v2,v3,v4,v5,v6,..v131071] index buffer 1: [0,1,2,...65535] index buffer 2: [0,1,2,...65535] Render all vertices: glVertexPointer(3, GL_FLOAT, sizeof(myVertexStruct),0); glDrawElements(index buffer 1); glVertexPointer(3, GL_FLOAT, sizeof(myVertexStruct),sizeof(myVertexStruct) * 65536); glDrawElements(index buffer 2);
  10. Hello! I was happily using glDrawElements with GL_UNSIGNED_SHORT index data for my index buffer rendering until I had to index terrain mesh larger than 256*256 vertices. But it turned out that OpenGL ES doesn't support GL_UNSIGNED_INT index data. How do I solve this problem now? Say, I want to index a mesh with 1024*1024 vertices. If I sub-divide this into smaller index buffers (like 256*256), it means I will have to create 16(!) index buffers just for that one mesh. Sounds really bad to me.
  • 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!