0 votes

Ubuntu 18.04 x64, Godot 3.2.1.

Trying to have some custom lighting on CPUParticles2D. Trying to rotate the LIGHTVEC using INSTANCECUSTOM.x but it seems to have no effect.

varying flat float rotation;

rotation = INSTANCE_CUSTOM.x; // in vertex func

// light func
float sn = sin(rotation);
float cs = cos(rotation);
LIGHT_VEC = vec2(cs * LIGHT_VEC.x - sn * LIGHT_VEC.y, sn * LIGHT_VEC.x + cs * LIGHT_VEC.y);

This doesn't work for me, particles look lit from random angles. How to get particle rotation in the shader?

in Engine by (28 points)
retagged by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.