I tried to implement the PBR material on Android.
At present, the direct light part works normally. But the indirect lighting is abnormal.
I use environment camera to create prefenvmap and iradiancemap for PBR materials. But the FBO reported an error. I’m trying something else.
Direct illumination:
Shader:
If someone has tried to write PBR material of mobile platform before. I hope I can get some help. Thank you.
Ali_RS
December 1, 2019, 5:08am
2
Why not using JME’s PBRLighting material?
JME’s PBRLighting now works on Android. Thanks to @joliver82
jMonkeyEngine:master
← joliver82:android-gl3
opened 12:44PM - 18 Jul 19 UTC
Added gles30 and newer functionality for android. All the information at the for… um thread: https://hub.jmonkeyengine.org/t/opengl-es-3-0-and-newer-on-android/41913
Chage list:
- Initialize the proper opengl context (2.0, 3.0, 3.1…)
- Added Caps for all of the new supported features
- Added Instancing as core feature of GLES30 and newer
- Properly adding versioning to shaders (#version xxx es) to shaders
- Added GLSL320,GLSL310 and/or GLSL300 to most materials depending on the required level for them to work properly
- Added depth24 texture usage if hardware supports it
- Enabled Geometry shaders and tessellation (3.2 core feature and 3.1 as extension) and fixed compilation errors on the examples
- Enabled glBlitFramebuffer
- Added GLSL300 to filters not able to work with GLSL100.
- Created Glsl300ShaderGenerator to support GLSL300 in shadernodes
- Fixed most shader compilation issues (strict type checking, adding OpenGL ES specific extensions, function usage depending on version and some other)
- Set default precision to highp solving most filter issues although maybe a little slower. Added specific sampler precision definition for gles300 or newer
- Make use of GL_TEXTURE_MAX_LEVEL in GLES300 to avoid black rendering of non complete mipmapped textures
- Changed some assets from compressed formats not supported in android to RGB/RGBA depending on the needs so all effects and tests can run also on android
- updated precompiled android.jar to have access to newest android API
- enabled some other core features of GLES300, GLES310 and GLES320
- Fixed build issues in jme3-android-examples
- Added 3D texture and texture array support
- Added float texture formats, fixed rgb8 format if having cap rgb8 and fixed glTexImage2D call on AndroidGL
- PBRLighting works and any other effect requiring HDR texture formats should work also
- Effects and postprocessing
- Multisampling
Known issues/pending work:
- Fixed most issues with shadow rendering in android (GLES 2.0 and GLES 3.0 or better) although some glitches still apear randomly depending on ShadowMode of the nodes and the device
- Fixed water filter. Still some rendering glitches in my old redmi3 (gles3.0). The water renders properly but the rest of the scene is overwritten in red. Not reproduced in any other device I've tried
If you want to give it a try you can build the engine from the master branch or wait for 3.3.0-beta1 release.
1 Like
Thank you,I use version 3.2.4. This version of the PBR material reports an error on Android.