Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mosatramparen

Pages: [1]
1
Why would you think it's not possible to use one texture if it's procedurally generated? How will you procedurally generate the texture then?
I'd assume you'd use a render texture to render the different procedural elements onto. Then you could simply get the texture from the RT and use that.

300 x 300 tiles = 90000 tiles = 180000 triangles
Whether this can be rendered easily or not highly depends on the hardware, but generally this should be doable for most systems. However if possible, I'd probably still try to use a vertex array if at all possible.

Sorry for explaining it poorly, turns out that I don't understand texturing completely. So my intuition tells me to create a "Tile" data structure that contains a Rectangle shape, and associate a texture with it (e.g. a wall texture or floor texture). Can you explain to me why  it would be more efficient to use a vertex array, and maybe a possible way to implement it? Not in complete code of course, but in general steps.

2
In a school project we are creating a roguelike game and it's my job to create the dungeons. To my understanding the best way to do this is to use VertexArrays because of performance reasons. However, since the dungeon will be randomly generated, it's not possible to have a complete texture for the dungeon. We will be creating our own textures as well.

One idea that came to my mind would be to generate the dungeon and then create the dungeon texture by looping over the quads and adding the corresponding individual texture (wall, door, corridor etc). This way I would only have to loop through all the tiles once and then I could draw the tilemap with a single draw command. Does this sound like a reasonable way to go about? I'm a bit concerned that this will be non-trivial, because our time is limited.

This comes to my second question: if we say that the map will have a maximum size of 300x300 tiles, can I get away by just drawing every quad individually? This way I could just create a Tile class with a rectangle member and texture it depending on its type. I know that this would be suboptimal, but given our time constraint I would rather take the easier option this time around.

Pages: [1]
anything