OMEGANAUT

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

New release for Omeganaut today with Virtual Reality!!! Put on your favorite VR device and blasts off your enemies in glorious 3D!

Also, the gamepad is back on Android. It was a problem coming from Zge.java that was replaced by a crappy one back in February. There are so many files everywhere when it comes to Android... I took the opportunity to clean all my ZGE folders and start from scratch.

If you have a fancy headset such as Oculus or Vive, I need your feedback, because all I have is a Google Cardboard :lol:

The game is here: https://www.txori.com/index.php?static21/omeganaut
But I'm thinking about making an itch.io page...
Last edited by Ats on Wed Dec 18, 2019 10:27 am, edited 1 time in total.
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

With all those animated screenshots and covers I made for the game, I finally decided to create an itch.io webpage :D
https://txori.itch.io/omeganaut
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

I'm experiencing a problem with shadows on Android (because of shaders) but also on some kind of PC. I saw that on a Twitch video, I'm still expecting that guy's response about his hardware. Maybe a chromebook? Anyway...

Here's the shadow when it works: a flattened spaceship colored with a single color darker than the ground.
shadow_ok.png
shadow_ok.png (2.85 KiB) Viewed 17100 times
And when it's broken: the ship is colored but keeps its original vertex colors. I think it's the result of vertex color + shadow color.
shadow_broken.png
shadow_broken.png (3.16 KiB) Viewed 17100 times

My shadow works like that:

A BitmapExpression that gets updated when the ground changes color:

Code: Select all

Pixel.R = 0.1 + GroundColor.X * 0.2;
Pixel.G = 0.1 + GroundColor.Y * 0.2;
Pixel.B = 0.1 + GroundColor.Z * 0.2;
Pixel.A = 1;
And a Vertex Shader:

Code: Select all

void main(void)
{
	vec4 v = vec4(gl_Vertex);
	gl_Position = gl_ModelViewProjectionMatrix * v;
}
I don't recall how I got to this, I made that in 2017... It's working, but not on Android.

So I was wondering if there could be an even simpler way to color an entire Model who HasVertexColors activated. Maybe by calling something like glMaterialfv to color the model with the needed color?


Edit: Or maybe I should just upgrade the project to GLBase ES2/GL3?
Last edited by Ats on Mon May 03, 2021 7:15 pm, edited 3 times in total.
User avatar
Kjell
Posts: 1921
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote: Mon May 03, 2021 6:13 pmSo I was wondering if there could be an even simpler way to color an entire Model who HasVertexColors activated.
Not really, the RenderMesh component automatically enables & disables the client state for all used vertex attributes, so you'd have to write your own RenderMesh function that allows you to control which attributes you want to use ( or add this feature to the RenderMesh component ).
Ats wrote: Mon May 03, 2021 6:13 pmIt's working, but not on Android.
If you want to use shaders on Android make sure to check out GLES2Demo.zgeproj in the Projects folder that comes with ZGE.

K
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

If you want to use shaders on Android make sure to check out GLES2Demo.zgeproj in the Projects folder that comes with ZGE.
That's exactly what I was looking at while you were responding :lol:
But I can't get it to work:

Error in Vertex shader compilation (Shader1)
0:1(1): error: syntax error, unexpected NEW_IDENTIFIER

Or is it working only on Android?
User avatar
Kjell
Posts: 1921
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,

Are you using App.GLBase = ES2/GL3?

K
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

Yes. I'm currently viewing the GLES2Demo and ES2/GL3 is activated.
User avatar
Kjell
Posts: 1921
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hmm,
Ats wrote: Mon May 03, 2021 6:53 pm Yes. I'm currently viewing the GLES2Demo and ES2/GL3 is activated.
Try adding "#version 140" at the top of each vertex & fragment shader source in that example. Shader compilers have become a lot more strict over the past years ( if you're using recent GPU drivers ).

K
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

With #version 140 I get new errors:

Error in Vertex shader compilation (Shader1)
Òÿÿœ°2
Error in Vertex shader compilation (Shader1)
VW@
Error in Vertex shader compilation (SpriteShader)
üËÿÿ¼°2

On the other hand, ShaderDemo.zgeproj is working fine, and even display a flattened teacup without error messages when ES2/GL3 is activated.
User avatar
Kjell
Posts: 1921
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

:|
Ats wrote: Mon May 03, 2021 7:14 pmWith #version 140 I get new errors
Weird, looks like there's some text-encoding issue going on ( at least with the errors ). Anyway, can you try removing the precision statements? It probably won't work on Android then, but perhaps that will make it work on Windows.
Ats wrote: Mon May 03, 2021 7:14 pmOn the other hand, ShaderDemo.zgeproj is working fine, and even display a flattened teacup without error messages when ES2/GL3 is activated.
That demo doesn't have any precision statements. But it shouldn't work when switching to ES2/GL3 though .. what GPU do you have?

K
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

It's not crashing without "precision mediump float;" but the result isn't impressive:
Screenshot_2021-05-03_21-22-19 (1).png
Screenshot_2021-05-03_21-22-19 (1).png (16.81 KiB) Viewed 17068 times
I'll try on the other computer tomorrow :wink:
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

And you where right. The drivers are tripping. Or maybe it's another problem with linux. I'll investigate tomorrow :wink:
User avatar
Kjell
Posts: 1921
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote: Mon May 03, 2021 8:27 pmAnd you where right. The drivers are tripping. Or maybe it's another problem with linux.
Are you running ZGameEditor in Wine or did you build a Linux standalone? And did you get the same results when trying ShaderDemo.zgeproj on Windows ( in case you tried that as well )?

Also, what shader version is supported by your GPU driver in Wine and / or Windows? It should mention that in the log after starting ZGameEditor.

K
User avatar
Ats
Posts: 791
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

Linux + Wine
The GL Shaders version is 4.60

GLES2Demo
wine_ESGL2_compatible_460 (1).png
wine_ESGL2_compatible_460 (1).png (18.89 KiB) Viewed 17053 times
"precision mediump float;" has to be deactivated otherwise it crashes. And I didn't see that there was a shader for the text too yesterday.

ShaderDemo (switched to ES2/GL3)
Screenshot_2021-05-04_09-07-17 (1).png
Screenshot_2021-05-04_09-07-17 (1).png (12.91 KiB) Viewed 17053 times
Windows
The GL Shaders version is 4.60 - Build 27.20.100.8280 for the laptop,
and 4.60 NVIDIA for the other one.

GLES2Demo
The result is the same with "precision mediump float;" deactivated or not.

ShaderDemo (switched to ES2/GL3)
The result is the same.
User avatar
Kjell
Posts: 1921
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote: Tue May 04, 2021 7:23 am"precision mediump float;" has to be deactivated otherwise it crashes.
Weird .. the "precision" statements should just be ignored unless you're running on ES or Vulkan. Quoted from the GLSL spec ( 1.3 and up ):

"Precision qualifiers are added for code portability with OpenGL ES, not for functionality. They have the
same syntax as in OpenGL ES, as described below, but they have no semantic meaning, which includes no
effect on the precision used to store or operate on variables."
Ats wrote: Tue May 04, 2021 7:23 amShaderDemo (switched to ES2/GL3) The result is the same.
That doesn't make sense .. try switching to ES2/GL3 then saving the file as ShaderDemoES2 and then reloading it. Maybe it's using cached shader objects or something.

K
Post Reply