Archived

This topic is now archived and is closed to further replies.

a2k

2d raster graphx vs. texture mapping

Recommended Posts

i'm thinking of implementing cockpit graphics, but i don't know which would be faster. render direct pixels to the screen (raster) or texture map a plane with the cockpit graphic? a2k (in OpenGL!! sorry!) Edited by - a2k on 4/9/00 6:32:13 PM

Share this post


Link to post
Share on other sites
Definitely texture mapping... Just draw up a BMP and map it to a quad. It''ll be much much faster than individual pixel plotting... No matter what the machine, pixel plotting is almost ALWAYS slower! Unless you know assembly, or some abstract way to access hardware acceleration, texture mapping will usually always try to use hardware acceleration by itself. Go with the texture mapping.


ColdfireV

Share this post


Link to post
Share on other sites
thanks for the advice. i was hoping somebody''d say that. i can even move the quad around for turbulence. heh heh. and just have texsubimage() for the instruments. thanks.

a2k

Share this post


Link to post
Share on other sites
One thing, though--
Don't render a whole huge screenful. If you do that, you will be calculating and rejecting thousands of transparent pixels.

I was working on something like this, and when I broke up the 'big quad' to be several smaller quads (ignoring HUGE areas that would be blank) I gained almost 10ms of rendering time.

So be aware-- when you render those texture quads, render as little transparent area as possible. Working with transparency is SLOW.


-- Goodlife

-----------------------------
Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Edited by - Goodlife on 4/10/00 8:34:09 AM

Share this post


Link to post
Share on other sites
thanks for the advice. yeah, i ran into that prob, and god was it ever slow. i''m still wondering if it would even be quick this way, because i''m still doubting it. i still have to experiment.

see, the prob is, with texture maps in ortho(), it still doesn''t produce the same image quality as a direct rasterization, but if i make the image large enough, detail gets better, but it''s still a large map, that means lots of pixels, that means slow. arg! how do the pros do it? anyway, it also sucks that opengl can''t accept 8-bit textures, otherwise it would be flying. if i''m wrong about the 8-bit bitmaps, please tell me, but i think i read that somewhere.

a2k

Share this post


Link to post
Share on other sites
Microsoft''s OpenGL implementation and most 2nd generation 3d cards can use the paletted texture extension. This lets you render GL_COLOR_INDEX textures (IE 8-bit).

I spent ages fannying around trying to get them to work - I finally did.

Go to my site to see how (shameless self-plugging )

Paul Groves.
http://home.clara.net/paulyg
OpenGL for Beginners

Share this post


Link to post
Share on other sites
hey, thanks a lot, pauly!

i''ve been wanting to load in 8-bit stuff, to speed things up, but does this mean i can load in 8 bit texture maps, but still use a different pixel depth for the actual screen image?

i want to load up 8 bit maps so it''s quicker and more room in video memory, but will it work while running in 16 bit mode 3d graphics?

Share this post


Link to post
Share on other sites
Yup, you can use any screen depth you like. You''re only using GL_COLOR_INDEX when you pass the texture image to OpenGL. You''re not making a GL_COLOR_INDEX rendering context...

As well as the space savings, I''ve found it useful for team graphics (you know, use the same textures - just a different palette)

Paul Groves.
http://home.clara.net/paulyg/ogl.htm
OpenGL for Beginners

Share this post


Link to post
Share on other sites