Archived

This topic is now archived and is closed to further replies.

The Orange Book - Brick Shader

This topic is 5010 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 have successfully got the vertex/fragment shader combo that textures an object with a brick texture and illuminates it working (as described in the Orange Book). When I changed the fragment shader to support antialiasing (later in the Orange Book), I get an error that simply tells me that the fragment shader "uses an undefined language element." And then it proceeds to run in software, which is, as always, incredibly slow. I thought it was the addition of the #define statement, but it turns out to not be the case. My graphics hardware is the Radeon 9700 Pro, which supports the needed extensions. Does anybody know what''s going on? Thanks

Share this post


Link to post
Share on other sites
Loops and if statements are currently exececuted in software. ATi hardware can''t deal with conditional statements, and the compiler isn''t capable of emulating them. Therefore, if you have a constant loop, you''d best unroll it yourself. You should be able to emulate most if statements too.

All this seems kind of silly in a high level language. Hopefully ATi will address this issue at some point. For now, just keep updating your drivers whenever they''re released.

Share this post


Link to post
Share on other sites
Well all that changed between the basic and antialiasing versions
of the brick shader are the following lines:

Aliasing:
useBrick = step(position, BrickPct);

Antialiasing:
#define Integral(x, p, notp) ((floor(x)*(p)) + max(fract(x)-(notp), 0.0))

useBrick = (Integral(position + fw, BrickPct, MortarPct) - Integral(position, BrickPct, MortarPct)) / fw;

The variablaes are all precisely defined (not a problem there)
and the #define statement seems to be fine as well. (If I
substitute explicity for the #define in the line useBrick = ...
I still get the same error.)

Also my hardware successfully copes with an if statement earlier
in the program.

Any ideas?

TT

[edited by - TThirion on March 26, 2004 11:48:56 AM]

Share this post


Link to post
Share on other sites
dunno.. have you manually expanded the integral-macro and tried that?




If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net

Share this post


Link to post
Share on other sites