Login  Register

Re: Java3D + OpenGL ES

Posted by philjord on Jan 19, 2019; 11:01pm
URL: https://forum.jogamp.org/Java3D-OpenGL-ES-tp4039401p4039410.html

Thomas,
I wasn't too clear I think, Java3D itself doesn't allow users to take advantage of advanced OpenGL features easily, but Java3D 1.7 on the ES pipeline supports nearly everything that Java3D 1.6 supports, and the advantage of being able to easily write shaders is very useful
The following are limitations:
1. Coordinates must be defined and float type, colors must be float type, if defined.
2. Decaling is not supported.
3. Model Clip is not supported and must be reimplemented in shaders
4. QuadArray or IndexedQuadArray cannot be supported.
5. Texture Lod, Filter, Sharpen and Combine cannot be supported.
6. Texture3D cannot be supported.
7. RasterOps from RenderingAttributes cannot be used.
8. ReadRaster for depth requires a custom shader and color read instead.
9. Note LineArray and LineStripArray will not render as nicely as the fixed function pipeline.

The SimpleShaderAppearance class will let you print out the resultant shader from a given set of attributes, so for most features an example shader can be seen.

1. Coordinates and colors in float is not a major change usually (if at all)
2. Decaling can be done in the shaders, SimpleShaderAppearance won't output an example
3. Model Clip needs to be implemented in shader and its a fiddly piece of work if needed, SimpleShaderAppearance won't output an example
4. QuadArray to Triangle array is normally trivial (just update the coordinate index to point at 1,2,3,1,3,4 instead of 1,2,3,4)
5/6. The texture features mentioned and Texture3D are old system that aren't needed anymore, just dump them.
7/8. RasterOps can all be done in shaders more nicely, SimpleShaderAppearance won't output an example

So in my experience of converting across, the Quad array index updates are required fairly often (particularly on any billboard type geometry) and the LineArray not rendering nicely makes stencil outlines look fairly rubbish.

I'm very happy to given more specific advice if you can point me at code examples that need updating.