Search found 1770 matches

by Kjell
Fri Jun 04, 2021 3:49 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about ES2/GL3 shaders

Hi Ats, Also, with your example, I get your desktop cell shape/color on preview mode, and your android cell on build and run. Same here, which is problematic .. you don't want your preview to look different from your standalone builds. However, i do get the same BitmapCells result as in the editor /...
by Kjell
Fri Jun 04, 2021 2:50 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about ES2/GL3 shaders

Hi guys, Just tried it myself using a simple ( ES 1.0 ) .zgeproj and i'm getting a different BitmapCell on Android as well ( compared to Desktop ). No problems with BitmapNoise and BitmapRect here though. However, i just had a look at the source code and BitmapRect uses legacy OpenGL calls, so it ma...
by Kjell
Fri Jun 04, 2021 12:28 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about ES2/GL3 shaders

Hi Ats,
Ats wrote:
Fri Jun 04, 2021 12:01 pm
where in the ZGE source code could I check how shaders are handled differently from computer to Android?
There's no difference. Shader sources are send to the OpenGL driver in plain-text and compiled by the driver itself. So it just depends on which OpenGL driver a device uses.

K
by Kjell
Fri Jun 04, 2021 9:51 am
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about ES2/GL3 shaders

Hi Ats, The error messages are caused by the fact that the "varying" and "attribute" keywords have been deprecated & replaced by "in" and "out" since GLSL ES 3.0. By the way, all of the official documentation on OpenGL ES can be found here . And in case you're just looking for the reference cards of...
by Kjell
Thu Jun 03, 2021 3:39 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about ES2/GL3 shaders

Hi Ats, So now it is displaying, but it's a weird cell bitmap instead of the noise bitmap :shock: No idea what's causing that .. maybe Ville can chime in? And if I add the directive #version 330 (I tried from 100 to 330), the whole screen is white on Android. GLSL ES 3.3 doesn't exist ( yet ). The l...
by Kjell
Thu Jun 03, 2021 1:35 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about ES2/GL3 shaders

Hi Ats, But I really don't understand why the noise bitmap is working on PC, but not on Android. It's just white. Could you try adding a BitmapExpression containing "Pixel.A = 1" to your NoiseBitmap? So, like this: ZZDC<?xml version="1.0" encoding="iso-8859-1" ?> <Bitmap Name="NoiseBitmap" Width="25...
by Kjell
Thu Jun 03, 2021 10:55 am
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, I was looking at your phong shader, and while it's really showing the use of Specular and Emission colors, it doesn't show up on ES2/GL3. Right, as mentioned .. it's a shader for legacy OpenGL so it doesn't work ( properly ) with ES2/GL3. I'm going to start over again, and searching for exam...
by Kjell
Thu May 27, 2021 11:28 am
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, Let's say, the phong one. That phong shader is written for legacy OpenGL ( GLBase = compatible ). I suspect you changed the "gl_ModelViewProjectionMatrix" part in the fragment shader, but that's not nearly enough to convert it to a modern shader ( GLBase = GL3/ES2 ). Anyway, here's what the ...
by Kjell
Thu May 27, 2021 10:41 am
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, What would be the logic to update the light shader, so the cube doesn't rotate with his shadows stuck on it? What light shader are you referring to? I looked at all the examples you posted in this thread but i can't find a light shader. I've read many explanations, but since GLES2 is aging f...
by Kjell
Wed May 26, 2021 2:03 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, And another weird thing is happening: when you press SPACEBAR to display the text, alpha shader cease to work. I'd really like to understand why... :? It's because you're enabling blending once in your App.OnLoaded and then RenderText overrides the OpenGL blend state and doesn't restore it p...
by Kjell
Wed May 26, 2021 1:25 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi guys, why the alpha transparency shader is working on App.OnRender, but not in Model.Onrender? You mean when previewing SphereModel? Transparency does actually work, but it's not very "pronounced" due to the background color and your alpha value. https://i.imgur.com/MiBPm8A.png I can use your met...
by Kjell
Tue May 25, 2021 5:10 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, Oh. So MeshSphere can't do that, but rounded MeshCube can. You can still use MeshSphere if you want .. you just need to add a MeshExpression where you assign the texture coordinates yourself. Here's a simple example: <?xml version="1.0" encoding="iso-8859-1" ?> <ZApplication Name="App" Capti...
by Kjell
Tue May 25, 2021 3:42 pm
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, But putting it to ModelDefined doesn't light up the sphere. It's still black in preview, and white in release. No texture. As mentioned, that's because MeshSphere doesn't generate any texture coordinates, so the bottom-left pixel ( texCoord 0,0 ) of your texture ends up being used for the en...
by Kjell
Tue May 25, 2021 11:07 am
Forum: General discussion
Topic: Questions about ES2/GL3 shaders
Replies: 47
Views: 2012

Re: Questions about GLES2 shaders

Hi Ats, The first should display the same texture as the ground, but it is black instead. You can't use "Generated" TexCoords ( which uses glTexGen ) in OpenGL ES, you have to use "ModelDefined". However, a MeshSphere doesn't generate texture coordinates for the mesh ( not sure why ) so you need to ...
by Kjell
Sun May 09, 2021 12:33 pm
Forum: Bug reports
Topic: One in two BitmapFont lose transparency on Android
Replies: 17
Views: 1360

Re: One in two BitmapFont lose transparency on Android

Hej Ville, Kjells suggestion sound ok, and it may not even be needed to save/restore the blend state at all. It depends on where it is used. Saving & restoring the blend state in RenderText.Execute isn't needed no, but since you haven't implemented attribute masking in fakePushAttrib it happens anyw...