Wolfwood Posted February 21, 2003 Share Posted February 21, 2003 Howdi, here is a little question for you all, The vex html help says, * Although P is modifiable in the surface context, at the current time, changing P will not affect the render of the surface, only shading. But when I try to write to P vcc throws the following error, "test.vfl" line 4 ERROR (1031) Illegal attempt to modify read only variable "P"P = P * 2; ^ REMARK (3003) 1 error and 0 warnings encountered REMARK (3007) No output is generated due to errors in the source code Here is a stupid sample that causes the above error, surface test() { vector Nn; P = P * 2; Nn = normalize(computenormal(P)); Cf = diffuse(Nn); } Are the help files outdated and P is no longer modifiable? Or am I misunderstanding the vec docs and need more Red Bull? jim. Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted February 21, 2003 Share Posted February 21, 2003 Hi Jim, I am not sure if I understand you correctly, but I think that P *= 2 is not allowed as you were trying to write to "P". But I am scratching my head as to what the VEX html meant.... Can you try something like this? surface test() { vector Nn; vector newP = P * 2; Nn = normalize(computenormal(newP)); Cf = diffuse(Nn); } Mo Red Bull? ALex Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted February 22, 2003 Author Share Posted February 22, 2003 Hey alex, I can understand not being able to write to P. Thats what displacement shaders are for. Like you suggested I'm just using another variable. I was just wondering why the docs said it was writable. Thanks jim. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.