Transforming single-pass into multi-pass shader

Posted By: BionicHero

Transforming single-pass into multi-pass shader - 01/02/06 15:17

Hi!
I took the HLSL shader for terrain multitexturing and added some extra textures for which I had to go up from PS1.1 to PS1.4.
However I want this to be also PS1.1-compatible so I wanted to transform the 1.4-single-pass shader into a 1.1-multi-pass shader. My problem is: How to do it? Do you have to render the first pass into memory and then sample that into the second pass? If yes, how do I have to code that? If not, how does it work instead?
Any directions would be great! I went over Google for over an hour and I found not a single multi-pass shader in HLSL...
Posted By: ello

Re: Transforming single-pass into multi-pass shade - 01/02/06 15:22

you need to use the blend states: srcBlend and destBlend. for the second and following passes you need to set EnableAlphaBlend = 1; and BlendOp = 1;

check the dx sdk documentation for those src and destBlend states
© 2024 lite-C Forums