Jump to content
  • Advertisement
Sign in to follow this  
burnate

ps1.2 - texenv

This topic is 4071 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all, im finding myself porting some pixel shader code over to regular texenv calls -- and im a bit rusty on my texenv knowledge.....so 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!