PDA

View Full Version : Conditional returns



Aeluned
07-27-2005, 05:29 AM
Is there a way to do conditional returns in fragment programs?

It keeps telling me the profile doesn't support it.

It seems silly that I can't bail out of the fragment program if I'm processing a fragment that was rasterized from a back facing polygon.

Thanks.

Relic
07-27-2005, 06:15 AM
What exactly doesn't work on which hardware?

al_bob
07-27-2005, 06:45 AM
It seems silly that I can't bail out of the fragment program if I'm processing a fragment that was rasterized from a back facing polygon.I question your intent.

Backfacing polygons are normally culled by backface culling. That is, they don't get rasterized anyway.

However, you can rasterize back-facing polygons if you disable backface culling.

But then, why would want to allow backfacing polygons, and then kill all the fragments there? Just enable backface culling and be done with it.

Aeluned
07-27-2005, 09:42 AM
My bad, didn't realize that back facing fragments were cut at the rasterization step. I guess it's ok then.

The problem stands however,

I have an NV 6800 GT...says profile doesn't support conditional returns in fragment programs.

whatever, it's not the end of the world I suppose.

Korval
07-27-2005, 09:56 AM
Why not use "discard"?

Humus
07-29-2005, 02:05 PM
Or better, just place the remaining part of the shader in an else-clause.