Shader Vop calculations

   2616   3   1
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Hi All,
Ive always wanted to know how the vop network for the shader runs its calculations. Lets assume I wrap up an Occlusion call inside a if block unless a condition is met for that if block will anything inside of that if block calculation wise be skipped or is information still obtained / run

Rob
Gone fishing
User Avatar
Member
8619 posts
Joined: 7月 2007
Offline
inside of the if statement is executed only if the condition is met otherwise is ignored
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
320 posts
Joined: 8月 2007
Offline
circusmonkey
Hi All,
Ive always wanted to know how the vop network for the shader runs its calculations. Lets assume I wrap up an Occlusion call inside a if block unless a condition is met for that if block will anything inside of that if block calculation wise be skipped or is information still obtained / run

Rob

I think it depends on whether or not your test condition is comparing against varying data, and you're executing a function that considers an area of points.

A conditional like this can split the object in two groups of points. If you test varying data like “s < 0.5” and call “texture()” there will be undefined values in the portion of the object that failed the test, while points in the portion that pass the test still reference these values. (leading to artifacts)

I know this is a limitation for prman, but I don't have time to test Mantra right now. I'd guess since it operates on batches of points in a SIMD fashion it holds true.
www.alan-warren.com
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Thanks for the input,Its made things very clear. I just wanted to make sure I'm being as efficient as possible with my shaders

Rob
Gone fishing
  • Quick Links