Do I have to settexture all the time?

Started by
1 comment, last by shakazed 21 years, 8 months ago
Since you have to re-render every frame about 33 times a sec, doyouI have to setup the ttextures every time? Cause that sucks computerpower like h*ll; Bad Monkey Productions
Advertisement
hello

it depends. say u have one polygon that uses one texture. and thats all that ever happens (i know a game would never be like this just bare with me)
so u have this one polygon being draw every frame. and no other polygons. this poly uses one texture only. so u can set this texture ONCE and that texture will be pasted onto the poly as long as u do not set another texture. when u set another texture then that texture will be the active one for that redering pass. and it will stay active as long as u dont set it to null or u dont set another texture.

so to render many polygons that use differnet textures u should arrange them into groups organized into what textures they use. it would be like this:-

set texture1
render all polygons that use texture1
set texture2
render all polygons that use tecture2


that will minimize the number of times u have to set textures in a single pass.

but if every poly used the same texture then u could have soemthing like this

void init()
{
set texture1;
}

init() would be called once at the start of teh program

then

render polygons.

that way all your polygons would use the texture you set at the beginnig, and they will keep on using that texture until u set another one.

please excuse the mess my reply is in

goodbye





Al Fareed
MY HQ

[edited by - alfmga on August 13, 2002 6:43:58 AM]
[size=2]aliak.net
Okay, well then that´s the way it is =) Thank you for your quick answer.



Bad Monkey Productions

This topic is closed to new replies.

Advertisement