The Orange Book - Brick Shader

Started by
5 comments, last by TThirion 20 years ago
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
Advertisement
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.

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

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]
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
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

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Sure did.

TT
Try taking out the if statement earlier in the program. Maybe it optimized out before but won''t now.

Just a suggestion!
I''ll play around with it and see if I can fix it. This is my first
GLSL render, so I was just curious. Thanks for the help, guys.

TT

This topic is closed to new replies.

Advertisement