GLSL support - ShaderObjectsState

"Chman" wrote:
"sonicviz" wrote:
Just wondering if this is why I can't get this one using sampler3D to work?
Well, as you've said, Jme doesn't seem to support 3D textures yet, that's why you can't use sampler3D...

Chman


sooooo...what's the deal with texture3D then?
It seems like a lot of the advanced GLSL demos use sampler3d so maybe jME needs support for it?

I was just wondering if there are any other parts of the gl spec apart from this (texture3d) that are not implemented?

considering we are a at release 0.7, yeah I imagine there are several unimplemented pieces. Luckily jME is actively developed and thus will likely have feature X implemented "soon".

Ok, I’ve made some fixes… I’ve changed the matrix2f FloatBuffer to a float array (easy to handle for the user, and although lwjgl uses buffers, other GL renders don’t, so they won’t have to extract the float array from the buffer).



I agree that using the ShaderUniform class does not give a very nice code :P, but it will work perfectly with JRE1.4 (I could use 1.5 features to delete this class and make thing nicer, but I don’t think you want Jme to be 1.5 dependant)…



Will this be commited ? Or do you want some changes ?



Chman

I’ll take a look at it as soon as I can. Did you update the posted code? Or is the new code somewhere else?

I’ve update the code in the first post :slight_smile:



Chman

I was thinking about how to use this with the light state system we have now and I came up with the idea of having a light state that sets the Uniform values instead of gl states. Would this work?

Hmm I don’t really understand what you mean… Or maybe… Do you mean that you would like to add a setUniform(String) to the light state to send the light attributes to GLSL ? If it is what you were thinking about, it could work, but I don’t think it’s a good idea… Making a glslState.setUniform(“myLightLocation”, myLight.getDiffuse().r, myLight.getDiffuse().g, myLight.getDiffuse().b) is easy and less confusing. Maybe I’ve misunderstood your post…



Chman

I was talking about making a new optional light state class the, in the apply function, updates the light information in the shadier. This would allow users to use feathers such as light sorting. The way you would do this in the old shadier code was access the gl state form the shadier. (You can see what was passed to the glLight * functions).

Edit: Invalid post.

Ah ? Is this due to my code or your implementation with the Light State ?

I meant to post this on another post.

:// ://

Ok, I plan on getting this in ASAP now. Probably tonight at the latest.

committed.