Jump to content
  • Advertisement
Sign in to follow this  
mikeman

Texture_Env_Combine question

This topic is 5472 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

I don't have really much experience about this, because I like using shaders or RC better, but I want to make my game run in older cards too. So I'm asking if this is possible: 4 texture stages: Result=(Tex0*Tex3.R) + (Tex1*Tex3.G) + (Tex2*Tex3.B); Is this possible in a single pass?

Share this post


Link to post
Share on other sites
Advertisement
>> but I want to make my game run in older cards too. So I'm asking if this is possible:

4 texture stages:

Result=(Tex0*Tex3.R) + (Tex1*Tex3.G) + (Tex2*Tex3.B);

Is this possible in a single pass?
<<

not possible not even on a gf2 or early radeons, ie u need a card with 4 texture units.

my advice is to not worry about the older cards just try to make it as good as possible on your card

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
>> but I want to make my game run in older cards too. So I'm asking if this is possible:

4 texture stages:

Result=(Tex0*Tex3.R) + (Tex1*Tex3.G) + (Tex2*Tex3.B);

Is this possible in a single pass?
<<

not possible not even on a gf2 or early radeons, ie u need a card with 4 texture units.

my advice is to not worry about the older cards just try to make it as good as possible on your card


I was wondering if I could do this for a card that supports 4 texture stages but not fragment programs. Or is it that all cards with 4 texture stages support fp too? I don't know about that.
Also,if I achieve that with multitexturing, it will boost performance even in my card. I own a GeForce 5200, and fragment programs are usually 50% slower that the fixed pipeline, even if they do the same thing.

Share this post


Link to post
Share on other sites
gf3 supports 4 texture stages, but not fragment shaders (in gl). However, it does support register combiners so you might be better off using those.

Older radeons only have 3 textures stages, so it won't work there.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Assuming that you can access the individual color components then, yes, you can do this in a single pass on a 4 t. unit card (like your GF5200). You would have to use the texture combiner functions (if you need a texture lookup, try pg438 on the Red Book for GL1.4;).

However, AFAIK you can't access the rgb components indepedently with register combiners, so you might need to do some magic to get it to work (or it may just be impossible). If you could get away with just 2 factors (ie. Tex3.rgb and Tex3.alpha) then it could be done.

Really, can't you just load the Tex3.r/g/b into the Tex0/1/2 alphas? Then you would only need 3 t. units and it would be doable.

Share this post


Link to post
Share on other sites
Ok,I explain:

What I'm trying to do is implement Radiosity Normal Mapping, as described in a paper about HL2 shading model. For that, I need 3 lightmaps for each tangent vector, and one normalmap. The equation is:

Result=Rad_T*dot(norm*vec3(1,0,0))+
Rad_B*dot(norm*vec3(0,1,0))+
Rad_N*dot(norm*vec3(0,0,1))

=Rad_T*norm.x + Rad_B*norm.y + Rad_N*norm.z
=Tex0*Tex3.R + Tex1*Tex3.G + Tex2*Tex3.B

This can be easily done with fp and it looks great. I was just wondering if it can be done with just multitexturing on cards with 4 textures. That's all. No register combiners,texture shaders,or ATI_Fragment_shader.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sorry, I should have said 'texture combiners' instead of 'register combiners'. So, it's realy just multitexturing.

That being out of the way, do these lightmaps need the alpha channel? (I am not familiar with the paper you describe) If not, then it can be done. If they do, then I cannot see a way of doing it, sorry.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Sorry, I should have said 'texture combiners' instead of 'register combiners'. So, it's realy just multitexturing.

That being out of the way, do these lightmaps need the alpha channel? (I am not familiar with the paper you describe) If not, then it can be done. If they do, then I cannot see a way of doing it, sorry.


No, they don't need it, but I can't encode the normalmap in the 3 alpha channels of the lightmaps, of course. The lightmaps are always the same for a level, but the normalmaps change.
Ok, I guess it can't be done in one pass. I'll just use more passes if the card does not support fp.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!