Jump to content
Sign in to follow this  

Modification of struct crashes mantra

Recommended Posts


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;

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.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this