Texture Array?

Started by
6 comments, last by baykalsa 19 years, 11 months ago
Hi.I am using Vertex Array for my RTS game.But I realized when trying to do fog of war thing Collor Array doesn''t help much.How can i assign different textures to quads which are in vertex array.I mean is it possible to tiling for vertex array.Are there anything like texture array.Or do you have any other ideas for Fog Of War?Thanks alot.
Advertisement
What''s wrong with OpenGL''s built in fog?
I want to make f.o.w like in Age Of Mythology.I think built in fog doesn''t help with that.GreenToad,if you have an idea please tell it.
quote:Original post by baykalsa
How can i assign different textures to quads which are in vertex array.I mean is it possible to tiling for vertex array.

You can''t, each rendering chunk (like one call to glDrawElements for vertex arrays) can only have one texture set (or a small collection of textures if using multi-texturing, but these then get applied to all textures).

You''ll need to gather together triangles with the same textures to render in one chunk. Although if its just fog of war then you might get better results just by using vertex colours, or theres a fog coord extension that lets you customise fog more (NeHe has a tutorial on it i think).

Ok.I am using collor array for fog of war.I want to smooth pass between open and fogged areas.I achieved this but it''s not good.
Let me explain.The vertex of quad:

v0 v1

v2 v3

making v1 and v2 and v3 colours are black,v0 white doesn''t result the same(meaning diogonal pass from white to black) as
making v0,v2 and v3 colours black and v1''s white!!

I think this is a problem with colouring vertex of a quad.
Quads are usually split into two triangles for rendering by the graphics card driver. Since the diagonal chosen for the split is arbitrarly chosen by the driver you may not get what you expect - different triangle placement affects the colour interpolation.

If its that big a problem, ditch quads and split them up into triangles yourself. Then you can make sure they all split the same way and you''ll get consistant results.
Yes I think this is the only way.Thank you.I have another question.I use Quads for my terrain engine.I want to do same terrain in Triangle strips.How??
Been a while since the question was posted so this may not help the poster, but anyone else reading the forum, I'll give this my best.

If you have a grid of quads that you want to render as a trianlge strip you can, but not perfectly. Ill explain...

Reason I say this is that you can do it in rows (or columns for that matter), but not all at once.

Warning incoming ASCII drawing:
v0----v1----v2----v3----v4----v5
|..\.......|..\....|..\....|..\....|..\....|
|.....\....|....\..|....\..|....\..|....\..|
|.........\|......\|......\|......\|......\|
v6----v7----v8----v9----v10---v11
(Ignore the periods they're spacing)

Just work you way through the vertices in a jagged method and you will make strips. (v6, v0, v7, v1, v8, v2, v9, v3, v10, v4, v11, v5) Then repeat for each other row (or col) and you will draw a grid. Depending on how many tiles wide your map is, the more time you will save as triangle strips are a bit faster than quads (2 trianlges).

NOMAD

[edited by - nomadman2003 on May 9, 2004 7:02:46 PM]

[edited by - nomadman2003 on May 9, 2004 7:03:28 PM]

This topic is closed to new replies.

Advertisement