View Full Version : Referencing a `normal` array element? (3Delight/SL)
kungfuelmosan 09-15-2007, 12:03 PM I just went to compile my shader (3Delight 6.5) and im getting errors
for trying to get an array element from a normal variable? I just
compiled the same shader at work with same version of 3Delight
yesterday morning and it worked fine?
normal NN = normalize(N);
color CN = color( NN[0], NN[1], depth(P) );
returns:
ERROR: variable 'NN' is not an array
that should work right?
Thanks in advance
|
|
1armedScissor
09-15-2007, 03:12 PM
I'm going to guess that the "normal" struct isn't an array, but rather a vector. Try finding the header file where the normal struct is defined & it will show you exactly how to access the individual elements.
cheers
rendermaniac
09-15-2007, 05:12 PM
You probably want this:
normal NN = normalize(N);
color CN = color( xcomp(NN), ycomp(NN), depth(P) );
I know prman you can reference vector components as if it was an array. This was added very recently. I don't know if 3delight supports this or not.
It is probably worth posting on the 3dlight forum too:
http://www.3delight.com/en/modules/PunBB/viewforum.php?id=5
Simon
Mauritius
09-20-2007, 01:57 AM
I know prman you can reference vector components as if it was an array. This was added very recently. I don't know if 3delight supports this or not.
It does. But not the 6.5 public release. If you're a customer, you can get access to intermediate versions. Otherwise wait for 3Delight 7.0 whiich is due very soon. :)
.mm
CGTalk Moderation
09-20-2007, 01:57 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.