Shadow map alpha testing question [SOLVED].

Started by
13 comments, last by dgreen02 18 years, 4 months ago
thanks to you too guys, i'll check it for sure!
Advertisement
Heh...looks like I spoke too soon...I'm having some trouble getting this to work. I'm still very new to shaders, and I'm having trouble finding a good resource on this particular topic.

ps.2.0//Constantsdef c17, 0.20, 1.0, 0.0, 1.0def c20, 0.0, 0.0, 0.0, 0.0...//Sample color maptexld r1, t2, s2//Alpha testmov r2, c20sub r2.r, r1.a, c17.xtexkill r2 ...//Output pixelmov oC0, r0

Alright this is what I have...it seems like it should work, but it fails to load.

If I take out either the sub, or the texkill it works fine (though no alpha testing). Could somebody explain to me why this doesn't work, I've been spinning my tires on this for a few hours now :-/ Mostly searching for info on how to properly use texkill.

When using texkill, I know that if any of the first 3 components are less than zero, the pixel will be killed. So I'm subtracting my "ALPHA_REF" value, stored in a constant, from the alpha value store in the texel I'm sampling...and storing it in the r component of a temp register...is there something not valid about that process?

Any help would be appreciated :-)

- Dan
If by "failing to load" you mean that compilation fails, check the errors returned by the compilation function or using psa (DXSDK\Utilities\Bin\x86\psa).

Yea true...good point about the psa and vsa utilities. I'll be making heavy use of these for all my shader development from now on.

These utilities sure are verbose...I could get spoiled with descriptive error messages like these [grin]. Now understanding it...that's another issue...

Quote:
scenerenderlocal.psh(142): error X5775: Dependent tex-op sequence too long (4th order).
A 1st order dependent tex-op is a tex[ld*|kill] instruction in which either: (1) an r# reg is
input (NOT t# reg), or (2) output r# reg was previously written, now being written AGAIN.
A 2nd order dependent tex-op occurs if: a tex-op reads OR WRITES to an r# reg whose contents,
BEFORE executing the tex-op, depend (perhaps indirectly) on the outcome of a 1st order dependent
tex-op. An (n)th order dependent tex-op derives from an (n-1)th order tex-op. A given tex-op may
be dependent to at most 3rd order (ps_2_0/x only).
assembly failed; no code produced


I take it that I'm abusing the r2 register with too many subsequent write commands?

If anybody could translate this into English, that would be great. In the meantime I'll be trying to figure it out.

- Dan
Turns out the pixel shader code I wrote/posted was right...and I was being stupid somewhere else [grin]

Here's how it looks in the game now..thanks for your help guys!


Cheers!

- Dan

This topic is closed to new replies.

Advertisement