Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
« previous
next »
Print
Pages: [
1
]
2
Go Down
Author
Topic: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。 (Read 5535 times)
specularlighting123
byte
Posts: 12
i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
on:
April 16, 2021, 12:36:19 pm »
hi,
i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
but in the android studio virtual simulator,i can see the reflection of the highlights。
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #1 on:
April 16, 2021, 01:20:58 pm »
Some devices don't really support it even if they should. Which version of OpenGL is your app using? if it's OpenGL ES 1.x, try OpenGL ES 2.0 instead. See:
https://www.jpct.net/wiki/index.php?title=OpenGL_ES_2.0_support
Logged
specularlighting123
byte
Posts: 12
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #2 on:
April 16, 2021, 01:54:12 pm »
after I set it up,the simulator also lost its effectiveness,it looks like there's no contrast,and saturation is very high。
(simulator:x86 , phone:arm)
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #3 on:
April 16, 2021, 04:43:35 pm »
You can forget about the simulator in OpenGL ES 2.0 mode. At least that was my experience, so I stopped using it altogether. There are some alternative Android emulators available, maybe one of them works better.
Logged
specularlighting123
byte
Posts: 12
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #4 on:
April 16, 2021, 05:18:08 pm »
x86 emulator,running is effective
other mobile phones,only shadows and higher saturation
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #5 on:
April 17, 2021, 11:31:42 am »
I'm not sure what you mean. Which image is which? Is that in ES 2.0 or 1.x mode?
Logged
specularlighting123
byte
Posts: 12
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #6 on:
April 17, 2021, 03:05:40 pm »
The first one:Run on ARM chip mobile phone
The second one:Run on android studio X86 emulator
I just started learning OpenGL,Just use demo to run a model file,Confused about the differences between the two platforms。The second image looks like a mirror reflection。
Logged
AeroShark333
float
Posts: 320
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone&#12
«
Reply #7 on:
April 18, 2021, 10:37:31 am »
OpenGL implementations differ per device model.
For myself, I have found that emulators actually produce most consistently good results (maybe this was different in the past but it seems fine for me).
I believe the specular lighting doesn't seem to work properly for you on one of both (I'm not sure which screenshot is tied to which device).
You can reduce the sun intensity values to reduce the 'mirror'-like reflections. (Specular lighting).
PS: do you have another phone/tablet you can test on?
Logged
My Minecraft skin viewer app:
https://play.google.com/store/apps/details?id=com.aeroshark333.skinviewer
specularlighting123
byte
Posts: 12
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #8 on:
April 18, 2021, 01:21:01 pm »
I tested about five different brands of mobile phones, and the mirror light was very weak.
I reduced the light source provided by the world class. It has a weak effect. But the effect looks bad.
Is there any way to improve?
Logged
AeroShark333
float
Posts: 320
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #9 on:
April 18, 2021, 06:54:39 pm »
I'm not entirely sure what you mean by that it looks 'bad'.
In one of your figures the specular lighting seems missing entirely..?
I believe the default specular lightning implementation uses Gouroud shading.
If you're unhappy with the results, I'd recommend writing your own shaders to implement Phong shading.
Logged
My Minecraft skin viewer app:
https://play.google.com/store/apps/details?id=com.aeroshark333.skinviewer
specularlighting123
byte
Posts: 12
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #10 on:
April 19, 2021, 02:53:57 am »
Thank you for your reply,I'm a rookie,Can you show me a shader example
。
Why is there a big gap between the first and the second?
The second one runs on the emulator。
The first one runs on the mobile phone。
Logged
AeroShark333
float
Posts: 320
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #11 on:
April 19, 2021, 12:42:22 pm »
Shader example:
https://www.jpct.net/wiki/index.php/Shaders
Scroll to last images/code for specular lighting implementation that might be interesting for you.
You can use this to load shader textfiles (both vertex shader and fragment shader) to String variables:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadTextFile-java.io.InputStream-
You can use this to create your own GLSLShader:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/GLSLShader.html#GLSLShader-java.lang.String-java.lang.String-
And finally you can use this to apply a GLSLShader to your Object3D:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setShader-com.threed.jpct.GLSLShader-
About the gap in graphical output:
Quote from: AeroShark333 on April 18, 2021, 10:37:31 am
OpenGL implementations differ per device model.
This means that one device might have a worse compiler (for the (default) shaders) than another device.
This will lead to artifacts in the graphical/rendered output.
Logged
My Minecraft skin viewer app:
https://play.google.com/store/apps/details?id=com.aeroshark333.skinviewer
EgonOlsen
Administrator
quad
Posts: 12297
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #12 on:
April 19, 2021, 02:58:04 pm »
It might also help to know what exactly this "mobile phone" is!? Model number, Android version?
Logged
specularlighting123
byte
Posts: 12
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #13 on:
April 20, 2021, 05:32:31 am »
In version 2.0, how can I get the default shader to modify the parameters?
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: i use setSpecificLighting (true) for Object3D,invalid on mobile phone。
«
Reply #14 on:
April 20, 2021, 07:29:36 am »
Which parameters?
Logged
Print
Pages: [
1
]
2
Go Up
« previous
next »
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
i use setSpecificLighting (true) for Object3D,invalid on mobile phone。