Sign in to follow this  

ps1.2 - texenv

Recommended Posts

burnate    122
hey all, im finding myself porting some pixel shader code over to regular texenv calls -- and im a bit rusty on my texenv i was wondering if i could get some of you wizz kids to help me out here. here's the code im trying to duplicate in texenv form. the problem im running into is the bias and expand from the pixel shader -- how would i represent that via texenv calls (using arb_texture_env_combine) of course.... <code> "def c0, 1, 1, 1, 1 "// multiply "def c1, 0.5, 0.5, 0.5, 0.5 "// add "tex r0, t0 " "mul r0, r0, c0.bias.2x " "add r0, r0, c1.bias.2x ", </code> where 'c0'+ 'c1' are color's that get updated as follows. <code> glTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_COLOR, color->vec); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); if(constant == 0) { glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); } else if(constant == 1) { glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA); } </code> any help you guys could offer would be immensly appreciated!!

Share this post

Link to post
Share on other sites
V-man    813
It depends on what c0.bias.2x is support to be
if it is 2 * c0 - 1
then it doesn't make sense cause c0 is already a constant.

Looks like the code reads a texel, then multiplies by 1, then adds 0?
If you want help, write the code in something more readable than ps1.2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this