
EDuke32 2.0 and Polymer! "talk about the wonders of EDuke32 and the new renderer"
#5726 Posted 25 September 2017 - 03:41 PM
Turns out I was wrong: crane behavior is indeed the same, but it is very weird.
The thing is you can only drop down the first time crane picks you up. Trying to do that the second time doesn't seem to work.
If you saved your game before the crane picks you up, it kinda resets. I don't know if that was the same in the original game.
To illustrate here's a quick video using 6450, same thing happens in other builds as well:
This post has been edited by Mister Sinister: 25 September 2017 - 03:42 PM
#5727 Posted 26 September 2017 - 06:13 PM
#5728 Posted 26 September 2017 - 07:16 PM
#5729 Posted 06 October 2017 - 04:33 AM
code is here:
getticks curtick ifvare prevtick -1 setvar DISPLAY_TEMP 0 else { readgamevar WHEEL1 readgamevar WHEEL2 setvarvar DISPLAY_TEMP curtick subvarvar DISPLAY_TEMP prevtick } addvar WHEEL1 2 ifvarg WHEEL1 2048 setvar WHEEL1 0 rotatespritea 10 135 INVENSIZE WHEEL1 3228 20 12 256 -255 0 0 xdim ydim subvar WHEEL2 4 ifvarl WHEEL2 -2048 setvar WHEEL2 0 rotatespritea 10 135 QUARTERSIZE WHEEL2 3228 10 12 256 -255 0 0 xdim ydim setvarvar prevtick curtick
it's not a massive issue of course, but just curious if it's a bug or if I need to change something. The readgamevar is there because I coded in a transition effect when a level is ending and it basically reads the position of the animation so it was seamless between gameplay and the level load.
#5731 Posted 12 October 2017 - 12:32 AM
#5733 Posted 12 October 2017 - 06:54 AM
I have been using Eduke32 on the GNU/LInux PC for a while now, and I would love to see this awesome sourceport working in the best possible way on the Raspberry Pi 3.
So, it builds and works good (not perfect because framerate is unstable even with the uncapped framerate and vsync, with a CPU usage of ~40%: I guess the audio thread has something to do with that) using SDL2 and the software renderer: then SDL2 upscales any "internal" video mode (like 320x200) to full screen resolution with zero CPU usage, because SDL2 renders each frame internally as a GLES2 texture.
That's for the state of Eduke32 on the Pi/SDL2.
So, what about the polymer renderer? Well, it would need to use OpenGL_ES1/2. I believe for basic shader support GLES2 would be enough. Is there any intention to give polymer GLES1/2 support?
SDL2 can initialize GLES1/2 rendering context easily, so that part is "done", so to say.
That would enable Eduke3D polymer renderer to run on a variety of ARM platforms that only have GLES1/2 implementations and not desktop GL.
#5734 Posted 12 October 2017 - 07:33 AM

#5735 Posted 12 October 2017 - 09:33 AM
Mark., on 12 October 2017 - 07:33 AM, said:

Oops, that's not too good...!
So, only the software renderer is being developed for the time being?
#5736 Posted 12 October 2017 - 09:39 AM
#5737 Posted 13 October 2017 - 12:34 AM
Mblackwell, on 12 October 2017 - 04:50 AM, said:
No dice sadly, doesn't even show up using that.
#5738 Posted 13 October 2017 - 12:44 AM
TerminX, on 12 October 2017 - 09:39 AM, said:
It does work or it "should" work? Would you give instructions for a SDL2+GLES build, please?
#5739 Posted 13 October 2017 - 07:58 AM
#5740 Posted 13 October 2017 - 10:08 AM
gaula92, on 13 October 2017 - 12:44 AM, said:
It "should" work. We got it working on Android with the addition of the extra object Hendricks266 mentioned, but we have not built for Android in over a year.
#5741 Posted 13 October 2017 - 06:37 PM
pi@raspberrypi:~/src/eduke32 $ make -j8 WITHOUT_GTK=1 USE_OPENGL=1 POLYMER=0 USE_LIBVPX=0 HAVE_FLAC=0 OPTLEVEL=3 LTO=0 OPTOPT="-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard" CUSTOMOPT="-DEDUKE32_GLES" In file included from source/build/include/build.h:23:0, from source/duke3d/src/astub.cpp:24: source/build/include/glbuild.h:28:20: fatal error: GL/gl.h: No such file or directory # include <GL/gl.h> ^ compilation terminated.
What the Pi DOES have is /opt/vc/include/GLES/gl.h. Should I include that instead of GL/gl.h?
This post has been edited by gaula92: 13 October 2017 - 06:40 PM
#5742 Posted 13 October 2017 - 07:14 PM
Mark., on 12 October 2017 - 07:33 AM, said:

Icecoldduke is officially gone now?
#5743 Posted 13 October 2017 - 08:25 PM
gaula92, on 13 October 2017 - 06:37 PM, said:
Change line 27 of glbuild.h from "#else" to "#elif !defined EDUKE32_GLES".
#if defined EDUKE32_OSX # include <OpenGL/gl.h> # include <OpenGL/glu.h> #elif defined EDUKE32_IOS # include <OpenGLES/ES1/gl.h> #elif !defined EDUKE32_GLES # include <GL/gl.h> # include <GL/glu.h> #endif
#5744 Posted 14 October 2017 - 05:44 AM
-I have to build with:
make -j8 WITHOUT_GTK=1 USE_OPENGL=1 POLYMER=0 USE_LIBVPX=0 HAVE_FLAC=0 OPTLEVEL=3 LTO=0 OPTOPT="-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -lGLESv1_CM -L/opt/vc/lib" CUSTOMOPT="-DEDUKE32_GLES -DHAVE_JWZGLES"
..since jwzgles.cpp would not build without -DHAVE_JWZGLES
I also had to include
#include <SDL2/SDL_opengles.h> #include <SDL2/SDL_opengl_glext.h>
in source/build/include/glbuild.h, because removing the GL/gl.h was leaving it without any GL or GLES headers and that caused a myriad of errors.
However, I still get:
In file included from source/build/src/polymost.cpp:19:0: source/build/include/polymer.h:127:5: error: 'GLhandleARB' does not name a type GLhandleARB handle; ^~~~~~~~~~~ source/build/src/polymost.cpp:643:45: error: 'GL_RGB5_A1' was not declared in this scope static int32_t const texfmts_rgb_mask[] = { GL_RGB5_A1, GL_RGBA, 0 }; ^~~~~~~~~~ source/build/src/polymost.cpp:644:40: error: 'GL_RGB565' was not declared in this scope static int32_t const texfmts_rgb[] = { GL_RGB565, GL_RGB5_A1, GL_RGB, GL_RGBA, 0 }; ^~~~~~~~~ source/build/src/polymost.cpp:644:51: error: 'GL_RGB5_A1' was not declared in this scope static int32_t const texfmts_rgb[] = { GL_RGB565, GL_RGB5_A1, GL_RGB, GL_RGBA, 0 }; ^~~~~~~~~~ source/build/src/polymost.cpp:645:41: error: 'GL_RGBA4' was not declared in this scope static int32_t const texfmts_rgba[] = { GL_RGBA4, GL_RGBA, 0 } ; ^~~~~~~~ source/build/src/polymost.cpp:656:45: error: 'GL_COMPRESSED_RGB8_ETC2' was not declared in this scope static int32_t const comprtexfmts_rgb[] = { GL_COMPRESSED_RGB8_ETC2, GL_ETC1_RGB8_OES, 0 }; ^~~~~~~~~~~~~~~~~~~~~~~ source/build/src/polymost.cpp: In function 'uint64_t (* Polymost_PickETCFunction(int32_t))(const uint8_t*)': source/build/src/polymost.cpp:684:14: error: 'GL_COMPRESSED_RGB8_ETC2' was not declared in this scope case GL_COMPRESSED_RGB8_ETC2: ^~~~~~~~~~~~~~~~~~~~~~~ source/build/src/mdsprite.cpp: In function 'int32_t mdloadskin(md2model_t*, int32_t, int32_t, int32_t)': source/build/src/mdsprite.cpp:912:46: error: 'GL_BGRA' was not declared in this scope int32_t const texfmt = glinfo.bgra ? GL_BGRA : GL_RGBA; ^~~~~~~ source/build/src/polymost.cpp: In function 'int32_t gloadtile_hi(int32_t, int32_t, int32_t, hicreplctyp*, int32_t, pthtyp*, int32_t, polytintflags_t)': source/build/src/polymost.cpp:1470:46: error: 'GL_BGRA' was not declared in this scope int32_t const texfmt = glinfo.bgra ? GL_BGRA : GL_RGBA; ^~~~~~~ source/build/src/mdsprite.cpp: In function 'int32_t polymost_md3draw(md3model_t*, const uspritetype*)': source/build/src/mdsprite.cpp:2111:24: error: 'GL_TEXTURE0_ARB' was not declared in this scope int32_t texunits = GL_TEXTURE0_ARB; ^~~~~~~~~~~~~~~ Failed building obj/build/mdsprite.o from source/build/src/mdsprite.cpp! GNUmakefile:951: recipe for target 'obj/build/mdsprite.o' failed make: *** [obj/build/mdsprite.o] Error 1 make: *** Waiting for unfinished jobs.... Failed building obj/build/polymost.o from source/build/src/polymost.cpp!
...which I don't get. Is the polymer include needed in polymost.cpp?
And, since glbuild.h is included in polymost.cpp, and I have also included SDL_opengl_glext.h (where GL_BGRA, 'GL_TEXTURE0_ARB, etc.. are defined), I shouldn't be getting those "not declared" errors...
Any more clues?
PD: I also tried manually copying the GL_BGRA, GL_TEXTURE0_ARGB, etc... defines from SDL_opengl_glext.h to mdsprite.cpp and polymost.cpp, and so I got eduke32 to compile, but I was still missing ProcessRGB and ProcessRGB_ETC2 (undefined reference on the linking phase). Removing the ProcessRGB* calls I got it to build but it would segfault on trying to setup the OpenGL renderer on the menu, with those:
OpenGL information Broadcom VideoCore IV HW OpenGL ES 2.0 Opened "textures" as cache file glGetError 0x500 glGetError 0x501 glGetError 0x501 glGetError 0x502 glGetError 0x501 glGetError 0x501 Segmentation fault
#5745 Posted 14 October 2017 - 07:22 AM
Add RELEASE=0 to the Make invocation to compile with debug symbols, and then you can use gdb to produce a backtrace of the segmentation fault.
#5746 Posted 14 October 2017 - 06:12 PM
#5747 Posted 14 October 2017 - 06:51 PM
Micky C, on 14 October 2017 - 06:12 PM, said:
Polymost is very stable even without TROR, so how could you tell if it is more stable with it? It seems like you would have to run about a million tests to verify that.
#5748 Posted 14 October 2017 - 06:55 PM
Micky C, on 14 October 2017 - 06:12 PM, said:
You might want to get that checked out.
#5749 Posted 14 October 2017 - 07:01 PM
Trooper Dan, on 14 October 2017 - 06:51 PM, said:
Maybe stable was the wrong word.
What I meant was that I remember there being an issue where if you looked down through TROR in polymost, there'd be a visual glitch which somewhat resembled red line sector walls drawing masked walls. That glitch seems to be gone. Of course, polymost still has other issues with TROR which prevent it from being useful in anything but the simplest cases.
#5750 Posted 14 October 2017 - 10:12 PM
Jblade, on 13 October 2017 - 12:34 AM, said:
Try removing the timing elements checking for tics and just increment a counter with that event. Like:
appendevent EVENT_GETLOADTILE ifvare LOAD_TRANSITION 0 { readgamevar WHEEL1 readgamevar WHEEL2 setvarvar LOAD_TRANSITION 1 } addvar WHEEL1 2 ifvarg WHEEL1 2048 setvar WHEEL1 0 rotatespritea 10 135 INVENSIZE WHEEL1 3228 20 12 256 -255 0 0 xdim ydim subvar WHEEL2 4 ifvarl WHEEL2 -2048 setvar WHEEL2 0 rotatespritea 10 135 QUARTERSIZE WHEEL2 3228 10 12 256 -255 0 0 xdim ydim endevent appendevent EVENT_ENTERLEVEL set LOAD_TRANSITION 0 endevent
You might need to draw the background yourself, but I'd try that anyway.
#5751 Posted 14 October 2017 - 11:30 PM
#5752 Posted 15 October 2017 - 03:49 AM
make -j8 RELEASE=0 WITHOUT_GTK=1 USE_OPENGL=1 POLYMER=0 USE_LIBVPX=0 HAVE_FLAC=0 OPTLEVEL=3 LTO=0 OPTOPT="-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -lGLESv1_CM -L/opt/vc/lib" CUSTOMOPT="-DEDUKE32_GLES -DHAVE_JWZGLES"
The good news is that, since I don't have to comment out the ProcessRGB* stuff anymore, there are no more segfaults.
The bad news is that I get a completely black screen with the OpenGL renderer. No surprise since I get those OpenGL error cores:
Setting video mode 640x480 (32-bpp windowed) Refresh rate: 60Hz polymost_glreset() OpenGL information Broadcom VideoCore IV HW OpenGL ES 2.0 polymost_glreset() Opened "textures" as cache file glGetError 0x500 glGetError 0x501 glGetError 0x501 glGetError 0x502 glGetError 0x501 glGetError 0x501
Any idea on what's going on? If this polymost GLES renderer works on Android (GLES1/GLES2) it should work on the Pi...
#5753 Posted 15 October 2017 - 08:35 AM
This page says you can bypass the error checking, it also explains what each error code means, too bad there aren't line nums... I'd also try to disable the texture cache maybe.
#5754 Posted 15 October 2017 - 01:59 PM
#5755 Posted 15 October 2017 - 02:30 PM
gaula92, on 15 October 2017 - 03:49 AM, said:
glGetError 0x500 glGetError 0x501 glGetError 0x501 glGetError 0x502 glGetError 0x501 glGetError 0x501
Any idea on what's going on? If this polymost GLES renderer works on Android (GLES1/GLES2) it should work on the Pi...
This is good progress, but unfortunately that log output (much like "Segmentation fault") provides almost no information about what is happening. Does running under gdb show anything more?
I wrote this function in glbuild.cpp:
GLenum BuildGLError; void BuildGLErrorCheck(void) { volatile GLenum err; while ((err = bglGetError()) != GL_NO_ERROR) { BuildGLError = err; // set a watchpoint/breakpoint here } }
It is used in some places, but not all. There have been times in the past where I have considered following each and every applicable GL call with a call to this function for more effective debugging.
I have also heard of dedicated GL / GL ES debugging tools, but I have no experience with them.
The error is probably simple, since we were able to build and run Polymost under GL ES on both Android and iOS.