View Full Version : Conditional returns
07-27-2005, 06: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.
07-27-2005, 07:15 AM
What exactly doesn't work on which hardware?
07-27-2005, 07: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.
07-27-2005, 10: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.
07-27-2005, 10:56 AM
Why not use "discard"?
07-29-2005, 03:05 PM
Or better, just place the remaining part of the shader in an else-clause.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.