system
December 30, 2016, 2:43pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
Mike Gringauz
Old Version
Published before Godot 3 was released.
Hi, friends!
Checked the official documentation, but couldn’t find any info.
Is it possible?
Happy New Year!!!
system
December 30, 2016, 4:07pm
4
Reply From:
Zylann
Shaders don’t do anything on their own, they must be set on a material.
In 2D, there is CanvasItemMaterial
. Then you can set the material on your 2D object.
And I think you can set the uniforms by doing this (for example):
sprite.get_material().set_shader_param("uniform_name", Color(1,1,1))
Thanks!!!
Mike Gringauz | 2016-12-30 16:23
system
April 18, 2018, 5:43pm
5
Reply From:
jarlowrey
In 3.0
Shader
uniform float my_value;
GD Script
self.material.set_shader_param("my_value",Color(0.26, 1, .9, 1))
If you set a parent material, make sure the child has updated with the new material/shader. Otherwise will encounter null errors
Well, you are setting vec3 (Color(x,y,z)
) to float (uniform float my_value
)…
splite | 2018-08-24 16:13