Last Attacker

Member
  • Content count

    402
  • Joined

  • Last visited

Community Reputation

172 Neutral

About Last Attacker

  • Rank
    Member
  1. Sub Texture

    I gave you all some extra points to make it up to all of you [wink]
  2. Sub Texture

    Quote:Original post by shurcool Perhaps it would be better not to use VBOs for that one quad you're using to display the 'radar'. Instead, render it normally and modify the texture coordinates to make it display only a small portion of your entire map. If your problem lies in the fact that your heightmap is very large, too big to fit in one OpenGL texture, you can just break it down into a grid of smaller textures and render using those accordingly (you may have to render up to 4 quads this way, when your view is over the corner where 4 smaller subdivided squares of your minimap meet). That way you would only need to generate the minimap texture(s) once at the beginning. If you need to display moving objects, it might be a good idea to separate them from the background and render them separately (you could use glScissor testing), on top of the static minimap. Those are just some ideas that come to me after reading what you've described trying to accomplish. Hope it helps. Thanks for your input, but I just used the radar as an illustration of what I wanted to achieve. I am using a texture for rendering my terrain. Sorry that I didn't sound very clear on the subject. I Guess I was in a little rush or something or didn't think to clearly. After a while I thought of using the Vertex Shader, I guess I was thinking inside the box ;). Still have to implement it though, but for interrest sake... is there a way of doing this in plain OpenGL? No Shader programming "allowed" ;) Thanks again... and sorry for the beat around the bush. I feel kinda stupid...
  3. Sub Texture

    Just one problem. VBOs. I have a couple of VBO vertex and texture coords buffers. Thus it's static. Don't tell me to resend those data to the video card. I think it will then make it 10x slower, or something. Then I could have just as well not have used VBOs.
  4. Sub Texture

    Quote:Original post by angry Quote:I hope I am making sence. You're not making any sence at all :P :D Sorry man. Had to type quick. Quote:Original post by angry Are you creating textures every frame?? Almost. I have to do a lot of buffer copying to send the resulting texture to the GPU. Quote:Original post by angry Uhm.. do you want to scroll the texture? Basically yes. I have a big buffer containing heightmap info and I have to take a sub image, make it a texture and send it to the GPU. As the camera moves I have to do this almost every frame. Still too costly though. I was hoping of creating a bigger than normal texture and tell the GPU to use only a sub part of that texture the size of what I normally wanted it to be, so when the camera moves, there should be no copying, just adjusting. Making sence now? ;p
  5. Sub Texture

    The thing is I am workig with Vertex Textures and I want to use a sub area of a texture untill I have to replace it with another texture. Think of it as a Radar in a RTS game. When that white box (your view port) moves to the side and reaches the edge, a new background is copied to the radar and the white box moves accordingly. Get what I'm saying? I am using it for a heightmap. Its for my year project. If it were possible to do, would there be any speed increases since no new textures have to be created so many times? Or how about the vertex shader? I hope I am making sence. Sorry I'm typing in a rush.
  6. Sub Texture

    No, I want to keep the texture coordinates static. I want to actually take a piece of the texture and use it asif it was an entire one without adjusting any texture coordinates.
  7. Sub Texture

    Yeah, but what if I have a 512x512 texture and a quad with (0, 0) -> (1, 1) texture coordinates and I want to use only half of the texture: (0, 0) -> (256, 256)?
  8. Sub Texture

    Hey everyone. I was just wondering if you can use an existing texture and use its sub region for texture mapping instead of the entire one without any copying or creation of new textures. Is this possible? Thanks
  9. OpenGL Mipmapping

    Quote:Original post by ivarbug int maxTextureUnits; glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&maxTextureUnits); Thanks man!
  10. OpenGL Mipmapping

    Quote:Original post by OrangyTang Vertex program texture fetches are unavailable on most hardware, and fiendishly slow on those that do support it. IMHO you'd be crippling your program with no real gain. Whats wrong with just using regular vertex array attributes? Well... firstly, I know it is kinda slow but its not that slow. I know that guys from nVidia claims that they have to make the architecture differently to support it more efficiently. Secondly, the way I've implemented it, it is minimized. I am using VBOs and Vertex Textures and its running with a relatively big terrain between 50-110fps with frustum culling and dynamic branching (and I have a nVidia 6200). Thirdly, my lecturer wanted me to implement it with vertex textures since he has already done the software one (I think, he showed me the demo). He wants to see how the GPU one would work and act. This is for my honours project. I also know that any other than nVidia 6/7 series cards doesn't support vertex-textures. EDIT: Also I believe that working with Vertex Textures greatly simplifies the whole process. IMHO. Quote:Original post by Tachikoma I would also check for the GL_SGIS_generate_mipmap extension and use it to generate mipmaps automatically if the feature is available. Otherwise, fall back to your own implementation it's not supported. edit: It's particularly useful if you want to generate all LODs quickly. I wanted to use the mipmap generation to manually load the necessary vertex textures of different LOD levels, but I am going to use a different approach now. Thanks anyway.
  11. OpenGL Mipmapping

    Thanks a lot man! It works now. I could answer my other questions after that worked, except question 3. 2 = YES!
  12. OpenGL Mipmapping

    Hmm... Ok, I have the following code: glGenTextures(1, &tex.id); glBindTexture(GL_TEXTURE_2D, tex.id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); //Send the texture with our vertex heightmap info terrain_info_t *sub; //Just my info for textures per LOD level sub = TL_SUB_INFO(0, 0, 0); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA_FLOAT32_ATI, sub->width, sub->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, sub->data); sub = TL_SUB_INFO(0, 0, 1); glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA_FLOAT32_ATI, sub->width, sub->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, sub->data); sub = TL_SUB_INFO(0, 0, 2); glTexImage2D(GL_TEXTURE_2D, 2, GL_RGBA_FLOAT32_ATI, sub->width, sub->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, sub->data); sub = TL_SUB_INFO(0, 0, 3); glTexImage2D(GL_TEXTURE_2D, 3, GL_RGBA_FLOAT32_ATI, sub->width, sub->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, sub->data); sub = TL_SUB_INFO(0, 0, 4); glTexImage2D(GL_TEXTURE_2D, 4, GL_RGBA_FLOAT32_ATI, sub->width, sub->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, sub->data); sub = TL_SUB_INFO(0, 0, 5); glTexImage2D(GL_TEXTURE_2D, 5, GL_RGBA_FLOAT32_ATI, sub->width, sub->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, sub->data); It doesn't want to build my mipmap. Any ideas?
  13. OpenGL Mipmapping

    Hey guys! Just a few questions regarding mipmapping in OpenGL. 1. How can I build my own mipmap levels without the gluBuild2DMipmaps() func? 2. Can you dynamically change the LOD texture associated with the mipmapped texture? In other words, can I decide later on to change the kind of texture to be used on LOD level 2, for instance? 3. Can I only have 8 textures (max) sent to the GPU (with multitexturing) at a time? Just out of quriosity. Aparently this is what my lecturer expects me to do for my geometry clipmaps implementation. To manually generate each terrain LOD layer and to feed it to the GPU for vertex texture fetches, sothat I would only update the levels that has changed instead of updating all 8 levels every time something changes. Thanks!
  14. Vertex Texture Problem

    Cool, thanks Brother Bob. I did the following and it worked: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); || \/ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); EDIT: I had this previously: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
  15. Vertex Texture Problem

    Hi guys, I have made a lot of progress with my geometry clipmaps implementation but I have a small problem that I just can't figure out. I am using displacement mapping with VBOs for implementing my geometry clipmaps algo. When mapping my vertex texture I do the following to load my texture: //Width - Image Width //Height - Image Height //colorMode - RGB, RGBA or LUMINANCE (Its an enum without GL_ prefix) //Data - Image Data gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA_FLOAT32_ATI, Width, Height, colorMode, GL_UNSIGNED_BYTE, Data); It works like that and it gives me this output: But... when I do it like this: //Width - Image Width //Height - Image Height //colorMode - RGB, RGBA or LUMINANCE (Its an enum without GL_ prefix) //Data - Image Data glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA_FLOAT32_ATI, Width, Height, 0, colorMode, GL_UNSIGNED_BYTE, Data); It comes out like this: Totally flat. No terrain at all. What you see above is multilple layers in wireframe mode with different colors to highlight the different layers. My Data variable is a 8-bpp 256x256 image. Any ideas why it could do this? Thanks