Pass Variables to Shader

I’m trying to learn shaders. However, I found a problem which I couldn’t find a solution to - passing on variables to the shader.



I’m trying to do this - but I highly doubt this is how it works (in fact it doesn’t :stuck_out_tongue: ):



Defines{

COLOR : Color

INT : size

}



And from the main program:



[java]mat.setInt(“size”, 1);[/java]

please read this docs

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:material_specification

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:material_definitions

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:jme3_shaders

1 Like

Thanks nehon, I was only looking in the shaders’ page. Got it to work.

Could try this as well…video tutorials just posted today :slight_smile:



http://hub.jmonkeyengine.org/groups/free-announcements/forum/topic/video-tutorials-introduction-to-shaders/#post-184094