Jump to content
  • Advertisement

Archived

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

TThirion

The Orange Book - Brick Shader

This topic is 5174 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
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.

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
Try taking out the if statement earlier in the program. Maybe it optimized out before but won''t now.

Just a suggestion!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!