Particles: How to set from ShaderMaterial the pass ShaderMaterial parameter?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MikeMikeMike

Hi…,

how to set from ShaderMaterial the pass ShaderMaterial parameter?

Thanks

Mike

This question is impossible to understand. Rephrase it.

Inces | 2022-02-05 22:20

:bust_in_silhouette: Reply From: rossunger

Here’s a tutorial:

:bust_in_silhouette: Reply From: MikeMikeMike

hi @rossunger,

in the particles-code I set my CUSTOM.x parameter:

shader_type particles;

void vertex() {
	if (RESTART) {
		CUSTOM.x = ...
	} else {
	}
}

How to pass this to the pass MaterialShader code:

shader_type spatial;

void vertex(){
	float c = CUSTOM.x; // this doesn't work

}

Any ideas?

Thanks

Mike

P.S.: I think COLOR is passed from the particles code to pass MaterialShader code, but COLOR gives me only 4 floats, perhaps I need more.