Simple texture filter
by Ian Omroth Hardingham · in Torque Game Engine · 11/21/2005 (5:00 pm) · 2 replies
Hey everyone.
What I'm trying to do would be ludicrously easy if I were using shaders, but I'm using standard TGE, so hopefully someone can help me out. I'm attempting to do a very simple real time filter on my player texture, for instance add 0.3 to the red value of every pixel: very simple. I'm concerned that creating a new texture by taking the old one and adding the filter will be too time consuming to do every tick (I want to dynamically change the filter and the player textures are 1024x1024), and was hoping that gl would let me apply a filter like that easily, although I'm having difficulty doing it as I'm not very experienced with gl.
I've taken a look at the shape fading code which seems to work fine for apha, like so:
however, changing anything but the alpha part of curColor has no effect.
Anyone shedding any light on this, or with any other ideas of how to achieve the effect, will be most appreciated :)
Ian
What I'm trying to do would be ludicrously easy if I were using shaders, but I'm using standard TGE, so hopefully someone can help me out. I'm attempting to do a very simple real time filter on my player texture, for instance add 0.3 to the red value of every pixel: very simple. I'm concerned that creating a new texture by taking the old one and adding the filter will be too time consuming to do every tick (I want to dynamically change the filter and the player textures are 1024x1024), and was hoping that gl would let me apply a filter like that easily, although I'm having difficulty doing it as I'm not very experienced with gl.
I've taken a look at the shape fading code which seems to work fine for apha, like so:
(from TSMesh::setMaterial)
ColorF curColor;
glGetFloatv( GL_FOG_COLOR, (GLfloat*)&curColor );
curColor.alpha = overrideFadeVal;
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, curColor);however, changing anything but the alpha part of curColor has no effect.
Anyone shedding any light on this, or with any other ideas of how to achieve the effect, will be most appreciated :)
Ian
About the author
Designer and lead programmer on Frozen Synapse, Frozen Endzone, and Determinance. Co-owner of Mode 7 Games.
#2
No, I haven't thought of that... will that only affect the model I'm currently trying to render?
Ian
11/21/2005 (7:49 pm)
Hey Ben, thanks for the reply.No, I haven't thought of that... will that only affect the model I'm currently trying to render?
Ian
Associate Kyle Carter