What it means is that inPosition should be a vec4 as it comes in. Thus no “casting” should be done. Of course if you’re certain the “alpha” or w is wrong that might be the best way.
remove the m_ prefix of the Color1 variable in the j3md file. Keep them in the shader files, jME will add them when parsing the j3md file since the m_ stands for material parameter.
your .j3m file is wrong, (same as .vert file…). Please post it…
@kwando said:
1. remove the m_ prefix of the Color1 variable in the j3md file. Keep them in the shader files, jME will add them when parsing the j3md file since the m_ stands for material parameter.
Yeah. Definitively that. In the case above, the shader, for it to work, should use m_m_Color1... ;)
What it means is that inPosition should be a vec4 as it comes in. Thus no "casting" should be done. Of course if you're certain the "alpha" or w is wrong that might be the best way.
Not necessarily, the value passed from JME is a vector3f which would correspond to a vec3, so it's ok getting it as a vec3 and adding 1.0 for the w value in the constructor.
Also it works if you use directly a vec4 and by some magic that i don't know a 1.0 is automatically fed into the w value....but since i don't know what does it, i prefer doing it with a vec3, because if on some drivers the w value is 0, the result would be unexpected...
@EmpirePhoenix said:
just as a simple help
m_ is added for material variables/uniforsm
right and that might be your problem @zzuegg. You define your color as m_Color1 in your j3md file, it should be Color1.
However the name of the uniform in the shader is fine (m_Color1) don't change it.
This is the result up to now, my first generated planet It allows to select 4 colors, as well as the ratio each layer should take from previous one, and of course setting a seed.
Some more questions, as you can see, the colors switch the ‘hard way’, I had to do that because adding the color simply with a plus (Color1.xyzstrengt + Color2.xyzstrenght) leads of course to weired results,
Add, for making animation stuff, i would need to access to something like a counter variable, does something like that exist?