Jump to content

Modification of struct crashes mantra


Green-Man

Recommended Posts

Hi!

I'm trying to organize some of my vex shaders. And trying to use struct for that.

But this kind of code crashes my mantra:

struct RayInfo { float clr; }

surface structVar(){
RayInfo ray = { 0.0 };
if( ptransform("space:world", P )[2] < 0.0 )
ray.clr = 1.0;
Cf = ray.clr;
}[/CODE]

So, it seems to crash only if try my modify struct non-uniformly.

Is it even legal to do like this, or structs are supposed to be constant?

Just in case, the compiled .otl version is in the attachment.

struct.otl

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...