m_ prefix form Material parameters is gone

Hi all,

just a message to explain the m_ change, introduced in this blog post : http://hub.jmonkeyengine.org/2011/01/12/jmonkeyengine-3-roadmap-gearing-up-for-last-alpha-release/#more-1215



The m_ prefix was here to remind that the parameter was a material parameter. But, in a material definition or in a call like material.setTexture(“m_Texture”,tex); you pretty much know that it’s a material parameter.



However it’s useful in a shader because you know that your m_Texture uniform comes from the material. the same way you know that g_ prefixed parameters are globals parameters



So this changes does that : now any material parameters in j3md, j3m files or use in java classes does not need to have a m_ prefix.

This won’t break your existing code, because if you use a m_ prefixed material name it will work and only raise a warning.



If you are making your own shaders every material parameter will be passed as uniforms to the shader with a m_ prefix



Example in a j3md file you have : Texture ColorMap

you can set it in a j3m file like that : ColorMap my/path/texture.png

in the code you can do : material.setTexture(“ColorMap”,text);



in the shader you’ll have : uniform sampler2D m_ColorMap

Just a head’s up here.



The material editor in jMP is half-broken since that update.



Preview won’t work and the editor will use the current (valid) values and also add the old ones with “m_” preposition.

Yeh, gotta update MaterialEdito since the j3md files changed.