May be a dumb question - I couldn’t find anything here on the forums or in the documentation:
If I am to learn shaders, is lwjgl or jogl (or a completely different one) the way to go with JME? Just want to make sure I end up on the right path (sort of easiest to get started when relying on JME).
I don’t know that it matters… but I think most folks here probably use lwjgl. So if there are any inconsistencies then that might slow down trouble shooting. Otherwise, they should behave the same with respect to shaders.
I suspect that if you want to “learn shaders… with JME” you probably want to read up on glsl and not worry about lwjgl/jogl as these layers are abstracted away from you.
Another question: In the fragment shader, is there any tpf information available? I want to create a shader, that alters the TexCoords based on framerate/timing.
JME also provides a standard g_Time or g_Tpf (pretty sure on that last one) if you enable them in your matdef.
No. They’re OpenGL wrappers… sort of. You should not care about them in this discussion. It’s just about literally like talking about OpenJDK versus Oracle JDK.
All of them since OpenGL 2. Maybe you should step back and tell us why you asked the question because that kind of question feels like you’ve already painted the floor behind you and are asking where the doors out of the room are.
Haha. No - I’m merely curious. Passionate about learning on the subject. I feel my goal is pretty simple - I’m just trying to learn as I go. I know it, with all likelyhood, wont matter for my intent
I guess the context would be that I am reading tutorials, guides and background information now, so if I come across anything that says ‘supported only in version X.Y’ - I would have a sense of whether or not the information can be used in my application.
I agree with the learn by doing approach. We all take in information in different ways and I feel that curiosity should never by dissuaded (even if its my own).
Essentially you should look into jme’s MaterialDef since it defines the shaders and also the possible input parameters which in turn are valued by the Material Instance.
The wiki has some tutorials about own shaders in jme however you might learn faster when using this shader eclipse fork whose Name i dont remember.
Also: the Version only depends on your Hardware (jme 3.1 needs 2.0 at least and uses some 3.x Features or extensions where possible and if not Fallback or manuelly work around)
Start the SDK or a jme game and Check the first Lines of Log for the Versions and extensions
No. One is setting vertex attributes. The other is setting uniforms…
I have a feeling if you opened Unshaded.j3md and then Unshaded.vert then a lot of your questions will be answered (or at least lead to more specific questions) as you try to figure out what the heck is going on and why there is a Color material parameter but an m_Color uniform and so on.
Already been there. I am not so vexed by the inside of the Vertex and Fragment shader, nor the Attributes, Uniforms or Varyings or general syntax. I am trying to catch up on how JME integrates (or how I feed or do not feed the shaders) so to speak. My aim is to have the shader update texture coordinates itself (basically: set texture, maybe set rows/columns, and in the shader then update position to show each piece of the texture one by one based on timings) - and I’ll get there in time I think.
I found out the JME already passes the uniform Tpf into the shader (accessible then via g_Tpf). Great stuff
The Shader documentation has broken links to UniformBinding.java and to VertexBuffer.java - I commented on the documentation. Not sure how else to report them.