Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
35 user(s) are online (18 user(s) are browsing Forums)

Members: 0
Guests: 35

more...

Support us!

Headlines

 
  Register To Post  

« 1 ... 22 23 24 (25) 26 27 28 ... 43 »
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Raziel
Lovely! On second screenshot you have what i have with letterfall3 game. Hans trying to fix that problem, and it was fixed, but still i have some kind of same issue somewhere (i just didnt report it at moment as worring with other ones at moment more important).

But at least in your case gl4es is not used, so or warp3d or ogles

Also what version of warp3dnova you use ? 1.58 ? Just dont remember in which one Hans fix it.

And trashed cursor probably come from sdl code, and not related to ogles2/nova


Edited by kas1e on 2019/3/26 14:42:48
Edited by kas1e on 2019/3/26 19:36:42
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@kas1e

version Libs/Warp3DNova/#?
Libs/Warp3DNova/W3DN_GCN.library: W3DN_GCN.library 1.58
Libs/Warp3DNova/W3DN_SI.library: W3DN_SI.library 1.58

Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Raziel
Found: http://www.amiga.org/developer/bugreports/view.php?id=342

See attached screens to bugreport: looks same as your onr.

Was fixed in v1.60, so wait for release or ask Mattew for beta version to see if it fixed fully


Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@kas1e

Thanks

Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Quite a regular
Quite a regular


See User information
I will release V1.60 of Warp3D Nova on Updater tool for public use this week.

amigakit.com - the Amiga store
Links: www.amigakit.com | New Products | Enhancer Software
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just can't stay away
Just can't stay away


See User information
@folks

I would like to see a pure OpenGL ES 2.0 thread. This thread should be about GL4ES wrapper, based on its title :)

About ScummVM cursor: no, it doesn't seem SDL issue. ScummVM doesn't call SDL_SetCursor (except once for openpandora). There was a recent MiniGL fix for another ScummVM cursor issue recently (glTexImage2D).

Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Capehill

I'll probably spam the wrong threads anyway not knowing the difference or which part bugs trigger...

Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Hans,Daniel

There is shaders in question when we have that issue in Lugaru:

Vertex one:

#version 100
precision mediump float;
precision mediump int;
uniform highp mat4 _gl4es_ModelViewProjectionMatrix;
attribute highp vec4 _gl4es_Vertex;
attribute lowp vec4 _gl4es_Color;
attribute highp vec4 _gl4es_MultiTexCoord0;
// FPE_Shader generated
varying vec4 Color;
varying vec2 _gl4es_TexCoord_0;

void main() 
{
    
gl_Position _gl4es_ModelViewProjectionMatrix _gl4es_Vertex;
    
Color _gl4es_Color;
    
_gl4es_TexCoord_0 _gl4es_MultiTexCoord0.xy _gl4es_MultiTexCoord0.q;
}


Fragment one:

#version 100
precision mediump float;
precision mediump int;
// FPE_Shader generated
varying vec4 Color;
varying vec2 _gl4es_TexCoord_0;
uniform sampler2D _gl4es_TexSampler_0;
uniform float _gl4es_AlphaRef;

void main() 
{
    
vec4 fColor Color;
    
vec4 texColor0 texture2D(_gl4es_TexSampler_0_gl4es_TexCoord_0);
    
fColor.rgb *= texColor0.rgb;
    if (
floor(fColor.a*255.) <= _gl4es_AlphaRefdiscard;
    
gl_FragColor fColor;
}


Also after seeing a last video, ptitSeb says that it's clearly not a "negative coordinates" effect, because the missing sides are in front of each other.


And i also add glClear(GL_COLOR_BUFFER_BIT); right before skybox.draw(); call, so to see everything correctly, and that how it looks like:

https://youtu.be/8yKKeOeHMzE

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Hans,Daniel

And to final note, which probabaly will bring us some light on at last.

After some tests find out that:

1). If i keep first 3 sides , and comment out 3 other sides , then first 3 sides draws correctly and where should

video of correct first 3 sides when 4,5,6st sides commented out:

https://youtu.be/-WzgbMkRQzc


2). If i uncomment any of the upcoming sides (4st or 5st or 6st) it always places on the place of the previous side. I.e. on the wrong place of the previous side.

there video when first 4 sides uncommented (can be seen how on 3st side placed 4st one, owerwriting 3st one):

https://youtu.be/YxiLJ3Mp9M0


3). Probabaly, its about GL_QUADS in end will be. I just replaced them all on pure GL_TRIANGLES, and

video of what i have with GL_TRIANGLES:

https://youtu.be/8qAJEevFMzI

So, this time all sides draws on correct place, connects one to each other together, and not broken like GL_QUADS (visually of course triangles, but the point is about right place and connection between).

And just in case, there is current skybox.cpp:

http://kas1e.mikendezign.com/aos4/gl4es/games/lugaru/Skybox.cpp

And the file where skybox.draw(); is called (in DrawGLScene(void) , line 345):

http://kas1e.mikendezign.com/aos4/gl4es/games/lugaru/GameDraw.cpp

It cleary something with GL_QUADS, right ? But then, it works for ptitSeb on Linux and Pandora (yeah i know, i know:) ) ..

Is warp3dnova know anything about GL_QUADS at all, or, its too low-level for, and its only ogles2 and gl4es know about that thing ?


Edited by kas1e on 2019/3/26 19:47:27
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Not too shy to talk


See User information
@kas1e
GL_QUADS is gl4es. Neither ogles2 nor Nova know this type of primitive. Maybe #447 after all ;)

Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Daniel
PtitSeb for sure will say that if he can't reproduce and its only on amigaos4, then its we need to find what wrong :(

And, its not that GL_QUADS not used anywhere else, they used all the time everywhere in all other games too, and that they fail there, can mean it fail not because of GL_QUADS itself, but maybe because of the setups before, or some commands which called before which didn't clear what should clear.

In gl4es's drawing.c i find that kind of code:

if (mode == GL_QUADS) {
        
mode GL_TRIANGLES;
        
int ilen = (count*3)/2;
        if (
iindices) {
            
gl4es_scratch(ilen*sizeof(GLuint));
            
GLuint *tmp = (GLuint*)glstate->scratch;
            for (
int i=0j=0i+3<counti+=4j+=6) {
                
tmp[j+0] = iindices[i+0];
                
tmp[j+1] = iindices[i+1];
                
tmp[j+2] = iindices[i+2];

                
tmp[j+3] = iindices[i+0];
                
tmp[j+4] = iindices[i+2];
                
tmp[j+5] = iindices[i+3];
            }
            
iindices tmp;
        } else {
            
gl4es_scratch(ilen*sizeof(GLushort));
            
GLushort *tmp = (GLushort*)glstate->scratch;
            for (
int i=0j=0i+3<counti+=4j+=6) {
                
tmp[j+0] = sindices[i+0];
                
tmp[j+1] = sindices[i+1];
                
tmp[j+2] = sindices[i+2];

                
tmp[j+3] = sindices[i+0];
                
tmp[j+4] = sindices[i+2];
                
tmp[j+5] = sindices[i+3];
            }
            
sindices tmp;
        }


Maybe that one need some big-endian changes dunno because of how it all placed in memory

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Daniel
And with GL_TRIANGLE_FAN same issue as with GL_QUADS. So, it then no conversion of triangles to quads then ?

And ptitseb says that after i check it with GL_TRIANGLE_FAN:

Well, the point is: simple QUADS are transformed in GL_TRIANGLE_FAN in gl4es. But if you force GL_TRIANGLE_FAN, no transform needed, and no transform done.
Also, if you put LIBGL_BEGINEND=0, no merging of stuff, and it's send mostly "as-is" to gles2 driver.
But here, because each face have a different texture, no merging occurs anyway... So the triangle fan is send untouched to gles2 driver...


Tadam, we come back on the same circle again :))

Also, if keep only 1,2 and 4 , but comment out others, then its even more funny:

https://youtu.be/9_CRj95BBkk

I.e. side which should be at bottom, draws on the place of the righg side, but at bottom still nothing (retested over minigl just in case : all draws as should)


Edited by kas1e on 2019/3/26 20:28:51
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
And, some more intersting stuff:

If i correctly rewrite those GL_QUADS/GL_TRIANGLE_FAN on proper GL_TRIANGLE , just one first side, then, 2st,3st and 4st sides being in QUAD/GL_TRIANGLE_FAN mode draws correctly, but 5st one start to draws in wrong place.

If i rewrite to proper GL_TRIANGLE 2st side together with 1st one, then, 3st, 4st and 5st sides in QUADS/GL_TRIANGLE_FAN mode start to draws correctly.

And if i rewrite to proper GL_TRIANGLE 1st, 2st and 3st side, then 4st, 5st and 6st sides in that QUADS/GL_TRIANGLE_FAN mode draws correctly too.

It looks like when it more than 3 QUADS/GL_TRIANGLE_FANS something going wrong. But what for sure , is that its only about QUADS/GL_TRIANGLE_FANS, pure GL_TRIANGLE works fine for sure.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@kas1e

So GL_TRIANGLE_FAN must be the trigger then. GL_QUADs are most likely converted to GL_TRIANGLE_FAN internally, given that GL_QUADs don't exist in GLES2, and have been deprecated/removed from newer versions of OpenGL.

I remember adding code to the old Warp3D W3D_SI driver to convert triangle fans to triangles. That boosts performance by rendering multiple tri-fans in one operation instead of having to send them one by one. Does GL4ES or the GLES2 library have something like that? If so, that code should be checked.

EDIT2: Actually, each quad needs to be drawn separately because they have different textures. So, the problem won't be quad->triangle conversion code.

Hans


Edited by Hans on 2019/3/27 5:18:11
Edited by Hans on 2019/3/27 6:05:30
Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Hans
Yep, Quads in gl4es is triangle_fans, and as i say before using pure triangle_fans instead of quads produce the same errors, while pure gl_triangles is not produce errors of that kind.

In previous post i also put answer from ptitseb:

Well, the point is: simple QUADS are transformed in GL_TRIANGLE_FAN in gl4es. But if you force GL_TRIANGLE_FAN, no transform needed, and no transform done.
Also, if you put LIBGL_BEGINEND=0, no merging of stuff, and it's send mostly "as-is" to gles2 driver.
But here, because each face have a different texture, no merging occurs anyway... So the triangle fan is send untouched to gles2 driver...


@Daneil
Is ogles2 translate GL_TRIANGLE_FAN and GL_TRIANGLE_STRIPs to the GL_TRIANGLE internally before sending them to warp3dnova ?


Edited by kas1e on 2019/3/27 7:18:11
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Just popping in


See User information
@kas1e

if (mode == GL_QUADS) {
        
mode GL_TRIANGLES;
        
int ilen = (count*3)/2;
        if (
iindices) {
            
gl4es_scratch(ilen*sizeof(GLuint));
            
GLuint *tmp = (GLuint*)glstate->scratch;
            for (
int i=0j=0i+3<counti+=4j+=6) {
                
tmp[j+0] = iindices[i+0];
                
tmp[j+1] = iindices[i+1];
                
tmp[j+2] = iindices[i+2];

                
tmp[j+3] = iindices[i+0];
                
tmp[j+4] = iindices[i+2];
                
tmp[j+5] = iindices[i+3];
            }
            
iindices tmp;
        } else {
            
gl4es_scratch(ilen*sizeof(GLushort));
            
GLushort *tmp = (GLushort*)glstate->scratch;
            for (
int i=0j=0i+3<counti+=4j+=6) {
                
tmp[j+0] = sindices[i+0];
                
tmp[j+1] = sindices[i+1];
                
tmp[j+2] = sindices[i+2];

                
tmp[j+3] = sindices[i+0];
                
tmp[j+4] = sindices[i+2];
                
tmp[j+5] = sindices[i+3];
            }
            
sindices tmp;
        }
        
count ilen;
    }


Assuming example: count=1 == should convert one quad to two triangles, right? (I don't know GL).

But at end of that code block it says "count = ilen" but ilen=count*3/2 which would be 1 in this example. 3/2=1.




Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Not too shy to talk


See User information
@Hans
@kas1e
Quote:
Is ogles2 translate GL_TRIANGLE_FAN and GL_TRIANGLE_STRIPs to the GL_TRIANGLE internally before sending them to warp3dnova ?

ogles2 doesn't know about quads in whatever style. ogles2 does not mess with the primitive type. It forwards the requested type to W3D Nova.
I wouldn't know why a different type would result in different behaviour other than the desired one, for ogles2 it's just a different constant it tells Nova.

@Georg
"count" is about vertices, not primitives. So for 1 quad count=4 -> ilen=6.

@kas1e
Did you eventually try it with a different optimizer level, -O1 or -O0? Does that make a difference? I know, it may sound naive, but I have my reasons

Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Georg

The code segment you quoted might not be used in this case. Have a look for "mode==GL_QUADS" in the same source-file. The GlDrawArrays() has its own quad to triangle conversion code. I'm not familiar with GL4ES' code, so I don't know which function is called when glBegin()/glEnd() is used.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
@Daniel
Quote:

ogles2 doesn't know about quads in whatever style.


Same issue is with GL_TRIANGLE_FAN and GL_TRIANGLE_STRIP as well.. but if you say that "ogles2 does not mess with the primitive type. It forwards the requested type to W3D Nova." , then probably it can be Nova in end ? Expectually if, as pritseb says, GL_TRIANGLE_FAN also sending untouched to ogles2 (which, resend it untouched to the warp3dnova) ?


Quote:

Did you eventually try it with a different optimizer level, -O1 or -O0? Does that make a difference? I know, it may sound naive, but I have my reasons


By default it compiled now as :

"-O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno -fsigned-char"

Then, i tried to remove it all and only -O2 , then only -O1, then only -O0 : all the time result the same as before.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Home away from home


See User information
Now, the next thing i tried, is to take the known to not work case like 1,2 and 4st face (yes, when there is just even 3 faces, but not one after another , but 1,2 and 4) then, instead of drawing 4st face on the bottom, its overwrite 1st face.

And then, i for sake of tests start to comment one glTexCoord2f() in first face one by one, and result are:

1). when keep only first glTexCoord2f(), but comment out 2,3,4st ones in first face: nothing draws (expected), but 4st face draws where should.

2). when keep 1st, 2st and 3st glTexCoord2f(), but comment out only 4st one, then, i have triangle on first face (of course expected), and 4st face still connects fine ! and all draws fine.

3). then, i take that 4st glTexCoord2f() of first face which is:

glTexCoord2f(0, 1); glVertex3f(-size, size, size);

and remove "-" thing. And then again, 1st face of course draws not as quad , but then other faces draws correctly !

And then, if i put "-" to any size of 3 arg in that 4st glTexCoord2f, it always broken the whole drawing of the 4st face, and it overdraw the first face.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 ... 22 23 24 (25) 26 27 28 ... 43 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project