www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on September 16, 2019, 06:45:59 pm

Title: Cpct?
Post by: AGP on September 16, 2019, 06:45:59 pm
Now that even Excelsior Jet has been made extinct, how would you feel about making a c# version of jpct? At least the OpenGL bits would be better.
Title: Re: Cpct?
Post by: EgonOlsen on September 21, 2019, 02:26:54 pm
Well, I'm not interested in C# at all. As long as I don't have to use it (and I don't see why that would happen), I won't touch it.
Title: Re: Cpct?
Post by: AGP on September 21, 2019, 07:07:51 pm
Even with the Mono project (and, thus, being multi-platform)? How come? Now that there's no way to make machine code out of Java, I think that I may go with C#.
Title: Re: Cpct?
Post by: EgonOlsen on September 23, 2019, 08:46:01 am
I looked into it briefly, I found it like Java with some additional clutter on top, that doesn't really make it any better and it's Microsoft. I have nothing against Microsoft, but the community is strange. Whenever I had to deal with the community of a Microsoft product (the scripting language in Powershell is an example where I had to rely on it, VBA for Access another), it's somehow disappointing...I've noticed a pattern:

Title: Re: Cpct?
Post by: AGP on September 24, 2019, 02:20:37 am
I have found every question I've ever had already asked and answered. I hope to be able to show something in the next few days.
Title: Re: Cpct?
Post by: AGP on September 27, 2019, 05:25:51 pm
I'm stuck in the FrameBuffer pixels thing. I found a way to do pretty much the same thing (https://stackoverflow.com/questions/1563038/fast-work-with-bitmaps-in-c-sharp (https://stackoverflow.com/questions/1563038/fast-work-with-bitmaps-in-c-sharp)), but pixels[] is too entrenched in the code.
Title: Re: Cpct?
Post by: AGP on September 30, 2019, 08:48:05 pm
Software renderer is compiled and running (not drawing anything yet, though).
Title: Re: Cpct?
Post by: AGP on November 05, 2019, 07:54:37 pm
I even ported the loader. Everything's working except for the actual rendering (when I don't assign random colors to the polygons in SoftGLRenderer). In clearSoftware(Color col), I'm printing this: Logger.log("Coloring. Color: "+color +", Col: "+col.ToArgb());

And the result is: Coloring. Color: 16711680, Col: -65536

Could this be a byte order thing or is it just because the first integer doesn't hold the alpha?
Title: Re: Cpct?
Post by: AGP on November 06, 2019, 06:08:24 am
Sure enough replacing pix=color; with pix=col.ToArgb(); started clearing. I'm now getting unshaded, untextured objects rendered against the appropriate color. Is my line much slower than your bit-shifting?
Title: Re: Cpct?
Post by: EgonOlsen on November 06, 2019, 12:59:23 pm
It's certainly slower. I'm not sure from where exactly this code snippet comes!? Is it inside the rendering loop or some loader/setup code. In case of the former, it might be critical.
Title: Re: Cpct?
Post by: AGP on November 06, 2019, 03:47:44 pm
It's in clearSoftware(Color).
Title: Re: Cpct?
Post by: EgonOlsen on November 06, 2019, 08:45:20 pm
I see. In that case, just move the call to col.ToArgb() out of the loop and assign the result, so that you don't have to do it thousands of times for frame.
Title: Re: Cpct?
Post by: AGP on November 07, 2019, 03:38:08 am
Done. But if the clear color was wrong, doesn't it follow that the texture-rendering stuff would be, as well (hence the unshaded sillouettes)? Put differently, where do I find the perspective-correct texture code in which to look for this issue?
Title: Re: Cpct?
Post by: EgonOlsen on November 07, 2019, 06:30:04 am
In the SoftGLRenderer.
Title: Re: Cpct?
Post by: AGP on November 07, 2019, 06:49:05 am
It's a bit hairy for me, since I don't really know what you're doing, but from what I gather alpha should be 24 bits shifted LEFT, red shifted 16 left, and so on. Is this line (under OptiZ) wrong (green is shifted by 8, then the whole thing gets shifted by 16)?
Code: [Select]
g=(((col>>8)&255)*(sgI>>10))>>16;
Title: Re: Cpct?
Post by: EgonOlsen on November 07, 2019, 10:33:48 am
No, it's fine. It's some fixed point magix. You should be able to port that just at it is. Apart from that, your assumptions about the colors is correct. It's plain ARGB format.
Title: Re: Cpct?
Post by: AGP on November 10, 2019, 08:22:45 pm
I read somewhere that the bytes are flipped. So before drawing I'm trying to change them the following way. I get only a blank screen, once more.

Code: [Select]
private static System.UInt32 ReverseBytes(System.UInt32 value) {
    value += 4278190080;//MAKE OPAQUE; IS THIS RIGHT? (THAT'S 1111 1111 0000 0000 0000 0000 0000 0000)
    return (value & 0x000000FFU) << 24 | (value & 0x0000FF00U) << 8 | (value & 0x00FF0000U) >> 8 | (value & 0xFF000000U) >> 24;
}
Title: Re: Cpct?
Post by: AGP on November 10, 2019, 08:47:30 pm
Update. I'm now getting a pretty fast framerate and rendering solid, shaded but untextured objects. (I was adding to the wrong byte and it was just OR 255):
https://www.dropbox.com/s/638qg16adshb77d/screenFromSoftGLRenderer.png?dl=0 (https://www.dropbox.com/s/638qg16adshb77d/screenFromSoftGLRenderer.png?dl=0)

Code: [Select]
private static System.UInt32 ReverseBytes(System.UInt32 value) {
    value = (value | 255);//MAKE OPAQUE
    return (value & 0x000000FFU) << 24 | (value & 0x0000FF00U) << 8 | (value & 0x00FF0000U) >> 8 | (value & 0xFF000000U) >> 24;
}

If I call setTexture on this MD2, Darth Vader becomes unshaded and solid black.
Title: Re: Cpct?
Post by: AGP on November 11, 2019, 12:31:05 am
Note: the following line produces, "Texture of polyID 1: DarthVader.png." And the texture was added to the TextureManager.

Code: [Select]
Logger.log("Texture of polyID 1: "+TextureManager.getInstance().getNameByID(sphere.getPolygonManager().getPolygonTexture(1)));
Title: Re: Cpct?
Post by: EgonOlsen on November 11, 2019, 10:23:59 am
I'm not sure about C#, but in Java, you have to handle the fact that the most significant bit of an int actually is the sign. So when shifting value & 0xff000000 down by 24, you have to remove the sign bit afterwards, because if not, you'll end up with some very different number from what you expect. See this test case:

Code: [Select]
public class ShiftTest
{
  public static void main(String[] args)
  {
    int value = 0xabcdef12;
    int cw = (value & 0x000000ff) << 24 | (value & 0x0000ff00) << 8 | (value & 0x00ff0000) >> 8 | (value & 0xff000000) >> 24;
    int cr = (value & 0x000000ff) << 24 | (value & 0x0000ff00) << 8 | (value & 0x00ff0000) >> 8 | ((value & 0xff000000) >> 24 & 0xff);
    System.out.println("wrong: "+Integer.toHexString(cw));
    System.out.println("correct: "+Integer.toHexString(cr));
  }
}

Maybe that's an issue here?
Title: Re: Cpct?
Post by: AGP on November 11, 2019, 03:58:02 pm
I know that Java doesn't have them, but should I just make pixels[] uint or is there a scenario when they're supposed to be negative?
Title: Re: Cpct?
Post by: EgonOlsen on November 12, 2019, 11:24:02 am
No, the are always positive.
Title: Re: Cpct?
Post by: AGP on November 13, 2019, 08:49:55 pm
I just spent much longer than anticipated converting pixels to uint[]. It works, now, but I'm getting the same result (shading if untextured, and a black silhouette if textured).

Have you another suggestion?
Title: Re: Cpct?
Post by: EgonOlsen on November 15, 2019, 12:03:05 am
I'm not sure...personally, I would create a set of uni-colored textures (one red, one green and one blue), set the ambient light to all white and see which color value a rendered pixel gets then. Maybe that helps to find the root cause.
Title: Re: Cpct?
Post by: AGP on November 15, 2019, 07:31:04 am
I wish that it were a mere matter of placement, but I'm not getting any texturing whatsoever.
Title: Re: Cpct?
Post by: EgonOlsen on November 15, 2019, 10:39:07 am
Then something in your loading/conversion is wrong. jPCT always uses a texture of some kind. It can't do without. What happens, if you don't set a texture at all? You should get a white texture then. If you don't, your reading from the texture's array is wrong. If you do, then your loading is wrong.
Title: Re: Cpct?
Post by: AGP on November 18, 2019, 12:28:22 am
I didn't know it always used a white texture. This is what it looks like with a green texture applied:

https://www.dropbox.com/s/638qg16adshb77d/screenFromSoftGLRenderer.png?dl=0 (https://www.dropbox.com/s/638qg16adshb77d/screenFromSoftGLRenderer.png?dl=0)
Title: Re: Cpct?
Post by: AGP on November 18, 2019, 12:42:08 am
And blue looks really blue. The problem, then, has to be in the texture coordinates, don't you think? And where might I fix them? And don't say the Loader class, because the same problem happens with multiple formats (and I have to have gotten at least one right lol).
Title: Re: Cpct?
Post by: EgonOlsen on November 19, 2019, 08:26:41 am
I somehow doubt that it's a coordinate issue...have you tried to use a less complex model for testing? Like a cube from http://www.jpct.net/doc/com/threed/jpct/util/ExtendedPrimitives.html#createCube(float) (http://www.jpct.net/doc/com/threed/jpct/util/ExtendedPrimitives.html#createCube(float))? If that displays a texture (maybe use some simple RGB colored one like one stripe or each compontent) with with wrong colors, your conversion or rendering is wrong. If it doesn't render a texture at all or it looks distorted, your coordinate handling is wrong. Albeit I don't know how you should habe managed to do that, because the data types used for these should be the same between Java and C#.
Title: Re: Cpct?
Post by: AGP on November 19, 2019, 08:34:24 am
I haven't ported ExtendedPrimitives, but my second model was sphere from Primitives (first one was an OBJ sphere). Same problem.
Title: Re: Cpct?
Post by: EgonOlsen on November 19, 2019, 12:53:53 pm
Yeah, but Primitives don't really have proper texture coordinates. That's the point of ExtendedPrimitives. I suggest to port that too to have something that helps to limit the possible problem sources.
Title: Re: Cpct?
Post by: AGP on November 20, 2019, 01:33:54 am
OK, done. Same thing: single-colored textures work, images don't (and the images aren't null, either).
Title: Re: Cpct?
Post by: EgonOlsen on November 20, 2019, 10:31:07 am
Then either your loading/conversion of the texture is wrong or your texture coordinates are. I tend to the former, because that's more likely to get broken in porting then some simple floats that should behave the same in both languages.
Title: Re: Cpct?
Post by: AGP on November 20, 2019, 07:37:24 pm
Loading an image is a simple call to Image.FromFile(filename). Which leaves us the texture coordinates. Would that be in Object3D?
Title: Re: Cpct?
Post by: EgonOlsen on November 21, 2019, 11:19:31 am
Loading an image is a simple call to Image.FromFile(filename). Which leaves us the texture coordinates. Would that be in Object3D?
Are you sure? Loading is one thing, but you have to make an int[]-array out of the loaded image. I would rather think that this step is wrong.
Title: Re: Cpct?
Post by: AGP on November 21, 2019, 07:26:03 pm
I applied my ReverseBytes to the texels and still got black. Actually, at first I got fully-transparent, then I switched the bitwise OR for a bitwise AND for alpha as follows and I was back to black.

Code: [Select]
private static System.UInt32 ReverseBytes(System.UInt32 value) {
    value = (value & 255);//MAKE OPAQUE IT's AN OR IN SoftGLRenderer. WHY?
    return (value & 0x000000FFU) << 24 | (value & 0x0000FF00U) << 8 | (value & 0x00FF0000U) >> 8 | (value & 0xFF000000U) >> 24;
}
    }
Title: Re: Cpct?
Post by: AGP on November 22, 2019, 08:30:37 am
You're a good man, Egon. You were right, the texels[] were black. I'm forced to use the following rather slow nested loop, but voilá, it works.

I think that I'm going to tackle a skeletal structure for it before I try my hand at a hardware renderer, but the eventual C# hardware renderer will benefit from direct access to OpenGL.

Code: [Select]
    int i = 0;
    for (int y = 0; y < image.Height; y++)
for (int x = 0; x < image.Width; x++)
     texels[i++] = (uint) image.GetPixel(x, y).ToArgb();

Title: Re: Cpct?
Post by: AGP on September 29, 2020, 10:51:16 pm
Skybox.render() is making my forest pink (not calling SkyBox.render, naturally, sees my forest green although the sky looks appropriately blue--and it doesn't escape me that blue+green=pink), for some reason. Have you any direction you might give me?
Title: Re: Cpct?
Post by: EgonOlsen on October 01, 2020, 07:09:08 am
Do you have a screen shot?
Title: Re: Cpct?
Post by: AGP on October 01, 2020, 02:33:40 pm
Without SkyBox:
https://www.dropbox.com/s/dy5aird4uw22a3p/Forest_NoSkyBox.jpg?dl=0 (https://www.dropbox.com/s/dy5aird4uw22a3p/Forest_NoSkyBox.jpg?dl=0)

With SkyBox:
https://www.dropbox.com/s/y8wqt06phx73ol1/Forest_SkyBox.jpg?dl=0 (https://www.dropbox.com/s/y8wqt06phx73ol1/Forest_SkyBox.jpg?dl=0)
Title: Re: Cpct?
Post by: EgonOlsen on October 01, 2020, 10:13:01 pm
What the hell...is that actually using the software or the hardware renderer?
Title: Re: Cpct?
Post by: AGP on October 02, 2020, 12:54:29 pm
I only ported the software. I haven't decided which way to go with hardware yet.
Title: Re: Cpct?
Post by: EgonOlsen on October 04, 2020, 09:45:38 pm
I'm not sure what I'm seeing there then. If somehow looks as if you are rendering parts that should be hidden by the alpha channel. Like as if the texel sampled to deal with alpha doesn't match the one of the actual color value. But I don't see how that could happen nor do I understand what this has to do with the skybox. Inwould create a simpler test scene and try to narrow it down to what actually triggers this behaviour. In this complex scene, it's a little hard to tell.
Title: Re: Cpct?
Post by: AGP on December 04, 2020, 08:51:09 pm
What calls init(boolean ok, int x, int y)?
Title: Re: Cpct?
Post by: EgonOlsen on December 04, 2020, 09:17:51 pm
In which class?
Title: Re: Cpct?
Post by: AGP on December 04, 2020, 09:41:36 pm
AWTGLRenderer. init((int, int, int, int, int) is being called, but not the real one.
Title: Re: Cpct?
Post by: EgonOlsen on December 05, 2020, 03:02:38 pm
I'm not quite sure what you mean. There is no such method in thre AWTGLRenderer itself. There is one GLBase though (which is extended by AWTGLRenderer) and that one is being called by init() in AWTGLRenderer.
Title: Re: Cpct?
Post by: AGP on December 05, 2020, 06:02:05 pm
I moved it to AWTGLRenderer! init((int, int, int, int, int) doesn't call it, init() does and I can't see what calls init().
Title: Re: Cpct?
Post by: EgonOlsen on December 05, 2020, 08:21:49 pm
These three references do...(see attachment).
Title: Re: Cpct?
Post by: AGP on December 09, 2020, 07:59:40 am
Thank you. I manually called init(...), but now I'm getting a black screen.

The following code
Code: [Select]
System.Console.WriteLine("execute(int, object[]): Parameters null? "+(parameters==null) +" Init? "+isInit +" Mode: "+mode);
prints the following:
Quote
execute(int, object[]): Parameters null? False Init? True Mode: 2
execute(int, object[]): Parameters null? False Init? True Mode: 0
execute(int, object[]): Parameters null? True Init? True Mode: 8
execute(int, object[]): Parameters null? True Init? True Mode: 1
execute(int, object[]): Parameters null? False Init? True Mode: 2
execute(int, object[]): Parameters null? False Init? True Mode: 0
Expanding command queue to 3000 entries!
execute(int, object[]): Parameters null? True Init? True Mode: 8
execute(int, object[]): Parameters null? True Init? True Mode: 1
execute(int, object[]): Parameters null? False Init? True Mode: 2
execute(int, object[]): Parameters null? False Init? True Mode: 0
and so on.

Do you have any useful insight here?
Title: Re: Cpct?
Post by: EgonOlsen on December 09, 2020, 10:10:57 pm
I don't know how much you've changed (obviously something, because otherwise, there would be no need to call init() by hand), so it's really hard to tell.

This line:

Code: [Select]
Expanding command queue to 3000 entries!
Indicates that your port never flushes the command queue, which usually happens, if no actual rendering happens for some reason. The queue fills with render commands, usually until you invoke the display() method AND your display implementation actually gets called (with normal LWJGL and software renderer, this happens instanstantly). With AWTGL and JOGL, it happens when the next iteration of the UI thread happens. I've no idea how C# handles this, though.
Anyway, if the queue never gets flushed, buffered commands will pile up like you see in this log output.
Title: Re: Cpct?
Post by: AGP on December 17, 2020, 07:40:47 am
The problem there was that it's not paintGL in OpenTK, it's OnPaint. I solved that one. I'm happy that it now clears to the right color. drawWireframe() tells me the right color for the wireframe, but draws nothing, and draw() makes a mess. Still, I'm very happy to be achieving any kind of drawing. Any insight here would be greatly appreciated (see below video).

https://youtu.be/Pfuo77vKUbo (https://youtu.be/Pfuo77vKUbo)
Title: Re: Cpct?
Post by: EgonOlsen on December 18, 2020, 12:24:22 pm
No idea what it's drawing there. What it is supposed to be?
Title: Re: Cpct?
Post by: AGP on December 18, 2020, 05:28:28 pm
Hahah, it's supposed to be Vader (at exactly this lighting and distance):

https://www.dropbox.com/s/2ch8ajcin5ukdm3/SupposedToBe.png?dl=0 (https://www.dropbox.com/s/2ch8ajcin5ukdm3/SupposedToBe.png?dl=0)
Title: Re: Cpct?
Post by: EgonOlsen on December 19, 2020, 03:13:56 pm
Have you tried something simple, like a box or a sphere? Do those render correctly?
Title: Re: Cpct?
Post by: AGP on December 19, 2020, 10:17:48 pm
Yes, everything looks exactly the same (that screenshot was from the C-sharp software renderer, so there's no question that the loading  is done right).
Title: Re: Cpct?
Post by: EgonOlsen on December 21, 2020, 10:23:12 am
It that a compiled object or not? Either way, have to tried the opposite?
Title: Re: Cpct?
Post by: AGP on December 22, 2020, 06:48:14 pm
I hadn't had  need of compiled objects because I was using the software renderer, so I don't have them yet.

What does it mean that only drawVertexArray() is being called (drawStrip() and drawPolygon() aren't)?
Title: Re: Cpct?
Post by: EgonOlsen on December 23, 2020, 07:03:49 pm
That's default behaviour, because it's usually the fastest way to do it (apart from compiling objects). You can disable it by setting:

Code: [Select]
Config.glVertexArrays=false;
Title: Re: Cpct?
Post by: AGP on December 24, 2020, 07:57:34 am
Apparently this caused the following error:
Quote
Unhandled Exception: System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Texture.setMarker(Int32 renderer, Int32 mark)
   at Texture.setMarker(Int32 mark)
   at AWTGLRenderer.drawStrip(VisList visList, Int32 ind, Int32 length, FrameBuffer buffer, World world)

Note that I've changed nothing about the setMarker method (though wouldn't the Hashtable class complain about the same problem?).
Title: Re: Cpct?
Post by: EgonOlsen on December 29, 2020, 04:25:12 pm
No, Hashtable and HashMap don't care about this. And why would they? I consider it to be rather...not stupid...but, well let's go with stupid anyway...behaviour to throw an exception in this case. You would have to modify the code to check for the key and remove/add it or replace it, if that's supported.
Title: Re: Cpct?
Post by: AGP on December 30, 2020, 07:56:40 am
I added the test. And then I think I fixed another issue. Now I'm only getting the appropriate background color, and convertTexture(Texture) is printing [ 12/30/2020 3:57:37 AM ] - ERROR: Failed to upload texture! texID, unhelpfully (helplessly?) is always 0.
Title: Re: Cpct?
Post by: EgonOlsen on December 30, 2020, 11:35:05 am
That's before the actual upload happens. All it does, is to make the GL driver generate an ID. If that fails, it's most likely that something with your handling of the native buffers is wrong...or whatever C# uses in this place.
Title: Re: Cpct?
Post by: AGP on December 30, 2020, 10:56:45 pm
About that, I made a GenericBuffer<T> class to mimic Java's xBuffer classes. But there's a chunk in convertTexture() where you do IntBuffer (GenericBuffer<int> in mine) buf = getSmallBuffer(); GL11.GenTextures(buf) and then you claim that the texture refence is now in buf. But buf is a local variable that's never called again.
Title: Re: Cpct?
Post by: EgonOlsen on December 31, 2020, 12:43:25 pm
The GenTexture call puts it there.
Title: Re: Cpct?
Post by: AGP on January 18, 2021, 10:30:58 pm
Happy 95% of what remains of this year, pal.

What's with WorldProcessor.createWSNormals()? It seems to me to be both a waste of processing time and a waste of memory.
Title: Re: Cpct?
Post by: AGP on January 22, 2021, 02:40:30 am
And what is supposed to be in visList.vobj[0]? It's become null as I tinkered with the World class.
Title: Re: Cpct?
Post by: EgonOlsen on January 22, 2021, 08:34:50 am
WorldProcessor.createWSNormals() is needed for the software renderer when using environment mapping in world space. In every other case, it's not even called. All it does is to create 3 float[]-arrays (per WorldProcessor thread) to store the world space normals in, if needed and only once. So as long as you don't use this feature, it won't be called and if you do, then you have to live with the additional memory overhead.

vobj[0] is like any other index of vobj[]. When using the software render, it stores the reference to either the object itself (in that case, it's the same as vorg) or, if the polygon that belongs at this index is being clipped, a reference to the object that contains the clipped polygons.
Title: Re: Cpct?
Post by: AGP on January 22, 2021, 05:30:59 pm
Can you think of a reason why it might be null? It doesn't happen with the 1.03 World instance, but does with the 1.31.
Title: Re: Cpct?
Post by: EgonOlsen on January 23, 2021, 09:45:40 pm
vobj and vorg are either populated with the same instance (the actual object itself) or vorg is the object and vobj is the clipped polygon object. If vorg isn't null, but vobj is, then the clipped polygon object is null for some reason.
Title: Re: Cpct?
Post by: AGP on January 23, 2021, 11:03:33 pm
I'm not getting any lights, I think, since I ported World to 1.31. Everything I render with the software renderer is fully, flatly, black.

And by the way, software rendering on 1.31 is SO MUCH slower than on 1.03 (possibly the transparency additions but I would think it's because of the overall bloating of the code).
Title: Re: Cpct?
Post by: EgonOlsen on January 25, 2021, 07:30:04 am
On my side, the software rendering code hasn't changed in ages. If something has been added, it has been added in a new method and leaves the old methods untouched, so having transparency added does nothing to the existing methods. It might be the runtime that for some reason decides not to just-in-time compile some methods or something like that.
Title: Re: Cpct?
Post by: AGP on January 27, 2021, 05:33:30 am
I'm not even where I was when I started porting this thing: now even when I don't call setTexture I get a solid black, unshaded model. Same models that were working before. I had SoftGLRenderer print System.Console.WriteLine("Pixel color: "+r +", "+g +", "+b +" Pixel: "+pixels[tx]) and I get for uint[] pixels the interesting value of 4,278,190,335 (binary 11111111000000000000000011111111) in drawShadedZbufferedFilteredScanline(). If you have any insights, please share them because I need them.
Title: Re: Cpct?
Post by: AGP on January 28, 2021, 02:06:29 am
Update: I had the epiphany of blitting the texture and calling setShadingMode(Object3D.SHADING_FAKED_FLAT). The texture blit looks perfect and SHADING_FAKED_FLAT made the model shade by the ambient light color (and still not by an added light), but fully and properly textured. I guess the problem would be in the gouraud shading block. Again, any direction would be greatly appreciated.
Title: Re: Cpct?
Post by: EgonOlsen on January 29, 2021, 09:09:49 am
The thing is that faked flat actually means exactly that: It's fake. It's still using gouraud shading (there are no other rendering modes in jPCT's software renderer) but with the same color used on every vertex. If that fixes something, I can only imagine that somehow, your light intensity calculation on the vertices is off.
Title: Re: Cpct?
Post by: AGP on January 29, 2021, 09:26:27 am
I'd say no lights are being calculated at all, because left untextured and gouraud all models appear black.
Title: Re: Cpct?
Post by: EgonOlsen on January 29, 2021, 12:04:58 pm
Then there should be at least the ambient lighting.
Title: Re: Cpct?
Post by: AGP on January 29, 2021, 04:03:01 pm
Found the issue, just don't get it. If it's not flatshaded, the following test will be false and even ambient lighting won't be calculated.

Code: [Select]
if (arrays[0][pos3] == 12345671 || isFlatShaded) { // Point already in the cache? Well then...
Title: Re: Cpct?
Post by: EgonOlsen on February 01, 2021, 04:32:49 pm
That's a placeholder value that indicates "not yet filled". Do ask why it has the value it has...I can't remember. Anyway, there should be code like this somewhere to clear this cache:

Code: [Select]
transformFlags[i] = 12345671;

Maybe you've ported that "away"...?
Title: Re: Cpct?
Post by: AGP on February 03, 2021, 05:31:11 am
No, I knew that that was in transformVertices. It came down to another C# difference (Dictionary throwing an exception for not finding a key prompted me to catch it and create a new array in WorldProcessor.getArrays but I wasn't calling thread2Arrays.Add(tc, arrays) in the catch block). Voilá. Now to figure out why I'm only getting the ambient lighting. ; )
Title: Re: Cpct?
Post by: AGP on February 03, 2021, 10:55:58 pm
In the gouraud shading block of Object3D.render(), I had to set colMul to 1 as follows. I hate that, but at least the lights are being calculated.

Code: [Select]
if (!discard) {
colMul += spec;
colMul = 1.00f;
...
Title: Re: Cpct?
Post by: AGP on February 04, 2021, 07:18:35 am
gx and gy are both 0. When I print the values of objVectorsnxTr[pos3] and invScaleFactor, as follows, I get the following output (at some point objVectorsnxTr[pos3] becomes 0).

Code: [Select]
Logger.log("objVectorsnxTr[pos3]: "+objVectorsnxTr[pos3] +", invScaleFactor: "+invScaleFactor);

Quote
objVectorsnxTr[pos3]: -0.02754658, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.3224086, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.001717074, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.5763285, invScaleFactor: 1
...
objVectorsnxTr[pos3]: 0.8757023, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.8600356, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.8600356, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.8709888, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9966896, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.4980774, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.3910597, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9446523, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.937071, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.07667674, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.8456958, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.1937691, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.5268521, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2584651, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.7911943, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.1983738, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.5489044, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.7925232, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.716369, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2036022, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.721458, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9182732, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.7018681, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.794013, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.5646043, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.6472638, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.1838191, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.4464325, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9402843, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.7470285, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.1453849, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.4424484, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.06958889, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.5219796, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.6994461, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.4723827, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2131859, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.5358245, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9231659, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.802191, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2096631, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9533308, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9807692, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9998421, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.766471, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.3366379, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.1630535, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.8853046, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2297132, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.08216921, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.970468, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.7117062, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.4429376, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.3802269, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2681608, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.923718, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9345775, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.8293254, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.6339014, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.2209611, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9219743, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.2492384, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.7921321, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9277812, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.995459, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9785283, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.7009124, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.084934, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.2503513, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.3185651, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.9098715, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.02948599, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9640496, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.4850884, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.5507149, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.2249548, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.2465971, invScaleFactor: 1
objVectorsnxTr[pos3]: 0.8845565, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.9476686, invScaleFactor: 1
objVectorsnxTr[pos3]: -0.8730187, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
objVectorsnxTr[pos3]: 0, invScaleFactor: 1
Title: Re: Cpct?
Post by: EgonOlsen on February 04, 2021, 11:42:10 am
These are the transformed normal vectors' coordinates. It might be possible, that the x coordinate is 0 for some polygons in your object (albeit unlikely). But that wouldn't affect the polygons where it isn't. I would assume that there's still something wrong with your check for "has been processed already"...that this wierd magic number, like here:

Code: [Select]
if (arrays[0][pos3] == 12345671 || isFlatShaded) {

Just change these occurences into something like

Code: [Select]
if (arrays[0][pos3] == 12345671 || isFlatShaded || true) {

If that helps, your handling/setting of this magic number is wrong.
Title: Re: Cpct?
Post by: AGP on February 08, 2021, 07:10:20 am
For now my little cheat is working (as did yours), so I moved this annoyance to the backburner. I'm getting interesting blitting behavior, which is to say that all blitting methods work sometimes, and all fail others (work on simple demos, fail on stress-test ones). Alas, it is also in the backburner.

So I'm back with the AWTGLRenderer, where I'm getting StackOverflowExceptions. Logger.log("AWTDisplayList.switchBuffers(): count: "+count +", Is vl[1] null? "+(vl[1]==null)) prints AWTDisplayList.switchBuffers(): count: 346, Is vl[1] null? True. And for more detail, execute prints the following block of commands and, when finished calling FrameBuffer.display() my test program prints "Rendered once." AWTDisplayList.vl[0] and vl[1] have both shown themselves to be null.

Quote
execute(int, object[]): Parameters null? False Init? TrueMODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? TrueMODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? False Init? TrueMODE_SET_FRUSTUM: 0
execute(int, object[]): Parameters null? False Init? TrueMODE_REINIT: 23
execute(int, object[]): Parameters null? False Init? TrueMODE_GRAB_SCREEN: 6
execute(int, object[]): Parameters null? True Init? TrueMODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 346, Is vl[1] null? True
Canvas.switchList() completing.
Rendered once.
Title: Re: Cpct?
Post by: AGP on February 16, 2021, 07:16:10 pm
I'm stuck here, Egon. I assume that that's a recursion problem, but I can't see where the recursion happens.
Title: Re: Cpct?
Post by: EgonOlsen on February 17, 2021, 11:57:01 am
vl(x) is non null only for added VisList instances. All other elements of that array are supposed to be null. And count being 346 doesn't seem unreasonable to me either. That's just the number of buffered commands in the list.
None of these value looks like a recursion/stack issue to me.

Is reset() ever called and how does the actual StackOverflowException looks like?

Title: Re: Cpct?
Post by: AGP on February 17, 2021, 08:27:55 pm
I don't know where to catch it and all I get is the following ("switchList completing" is printed right after reset() is called).

Quote
switchList() completing.

Process is terminated due to StackOverflowException.
Title: Re: Cpct?
Post by: EgonOlsen on February 18, 2021, 09:08:09 am
So the C#-Runtime doesn't feel obliged to print the actual location of the exception? That's strange.

In that case...I don't know. Maybe using a debugger helps to find it or, which would be what I would do, adding some log output to each and every method that might cause this...
Title: Re: Cpct?
Post by: AGP on February 22, 2021, 07:55:06 am
It seems that C# is just not good with StackOverflowExceptions. I installed WinDbg and, not usefully, got the following output. I really don't know how to use debuggers. LOL
Quote
Microsoft (R) Windows Debugger Version 10.0.20153.1000 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: D:\MyPrograms\3D\Demo3D\DemoGL.exe

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is:
ModLoad: 00000000`00b20000 00000000`00b28000   image00000000`00b20000
ModLoad: 00007ffe`bfce0000 00007ffe`bfed0000   ntdll.dll
ModLoad: 00007ffe`aabe0000 00007ffe`aac44000   C:\windows\SYSTEM32\MSCOREE.DLL
ModLoad: 00007ffe`be8d0000 00007ffe`be982000   C:\windows\System32\KERNEL32.dll
ModLoad: 00007ffe`bda40000 00007ffe`bdce5000   C:\windows\System32\KERNELBASE.dll
(601c.3670): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007ffe`bfdb0fac cc              int     3
0:000> sxe ld clr
0:000> .loadby SOS.dll clr
Unable to find module 'clr'
0:000> sxe ld clr
CommandLine: D:\MyPrograms\3D\Demo3D\DemoGL.exe

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is:
ModLoad: 00000000`00390000 00000000`00398000   image00000000`00390000
ModLoad: 00007ffe`bde30000 00007ffe`bded3000   C:\windows\System32\ADVAPI32.dll
ModLoad: 00007ffe`bfce0000 00007ffe`bfed0000   ntdll.dll
ModLoad: 00007ffe`be500000 00007ffe`be59e000   C:\windows\System32\msvcrt.dll
ModLoad: 00007ffe`bdd90000 00007ffe`bde27000   C:\windows\System32\sechost.dll
ModLoad: 00007ffe`be0a0000 00007ffe`be1bf000   C:\windows\System32\RPCRT4.dll
ModLoad: 00007ffe`aabe0000 00007ffe`aac44000   C:\windows\SYSTEM32\MSCOREE.DLL
ModLoad: 00007ffe`be8d0000 00007ffe`be982000   C:\windows\System32\KERNEL32.dll
ModLoad: 00007ffe`bda40000 00007ffe`bdce5000   C:\windows\System32\KERNELBASE.dll
ModLoad: 00007ffe`aab30000 00007ffe`aabda000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll
ModLoad: 00007ffe`be040000 00007ffe`be092000   C:\windows\System32\SHLWAPI.dll
ModLoad: 00007ffe`be1c0000 00007ffe`be4f7000   C:\windows\System32\combase.dll
ModLoad: 00007ffe`bd8e0000 00007ffe`bd9da000   C:\windows\System32\ucrtbase.dll
ModLoad: 00007ffe`bcd00000 00007ffe`bcd81000   C:\windows\System32\bcryptPrimitives.dll
ModLoad: 00007ffe`bdf10000 00007ffe`bdf36000   C:\windows\System32\GDI32.dll
ModLoad: 00007ffe`bcc60000 00007ffe`bcc81000   C:\windows\System32\win32u.dll
ModLoad: 00007ffe`bcf10000 00007ffe`bd0a8000   C:\windows\System32\gdi32full.dll
ModLoad: 00007ffe`bdcf0000 00007ffe`bdd8e000   C:\windows\System32\msvcp_win.dll
ModLoad: 00007ffe`beb30000 00007ffe`becc4000   C:\windows\System32\USER32.dll
ModLoad: 00007ffe`bdee0000 00007ffe`bdf0e000   C:\windows\System32\IMM32.DLL
ModLoad: 00007ffe`bcc40000 00007ffe`bcc51000   C:\windows\System32\kernel.appcore.dll
ModLoad: 00007ffe`b7660000 00007ffe`b766a000   C:\windows\SYSTEM32\VERSION.dll
ModLoad: 00007ffe`693b0000 00007ffe`69e72000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
ntdll!NtMapViewOfSection+0x14:
00007ffe`bfd7d294 c3              ret
0:000> sxe ld clr
0:000> .loadby SOS.dll clr
0:000> !stoponexception -create System.StackOverflowException
Breakpoint set
0:000> g
ModLoad: 00007ffe`aa460000 00007ffe`aa51d000   C:\windows\SYSTEM32\ucrtbase_clr0400.dll
(2de4.1258): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007ffe`bfdb0fac cc              int     3
1:001> g
ModLoad: 00007ffe`b6400000 00007ffe`b6416000   C:\windows\SYSTEM32\VCRUNTIME140_CLR0400.dll
ModLoad: 00007ffe`bde30000 00007ffe`bded3000   C:\windows\System32\ADVAPI32.dll
ModLoad: 00007ffe`be500000 00007ffe`be59e000   C:\windows\System32\msvcrt.dll
ModLoad: 00007ffe`bdd90000 00007ffe`bde27000   C:\windows\System32\sechost.dll
ModLoad: 00007ffe`be0a0000 00007ffe`be1bf000   C:\windows\System32\RPCRT4.dll
ModLoad: 00007ffe`aab30000 00007ffe`aabda000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll
(601c.3670): Unknown exception - code 04242420 (first chance)
ModLoad: 00007ffe`be040000 00007ffe`be092000   C:\windows\System32\SHLWAPI.dll
ModLoad: 00007ffe`be1c0000 00007ffe`be4f7000   C:\windows\System32\combase.dll
ModLoad: 00007ffe`bd8e0000 00007ffe`bd9da000   C:\windows\System32\ucrtbase.dll
ModLoad: 00007ffe`bcd00000 00007ffe`bcd81000   C:\windows\System32\bcryptPrimitives.dll
ModLoad: 00007ffe`bdf10000 00007ffe`bdf36000   C:\windows\System32\GDI32.dll
ModLoad: 00007ffe`bcc60000 00007ffe`bcc81000   C:\windows\System32\win32u.dll
ModLoad: 00007ffe`bcf10000 00007ffe`bd0a8000   C:\windows\System32\gdi32full.dll
ModLoad: 00007ffe`bdcf0000 00007ffe`bdd8e000   C:\windows\System32\msvcp_win.dll
ModLoad: 00007ffe`beb30000 00007ffe`becc4000   C:\windows\System32\USER32.dll
ModLoad: 00007ffe`67db0000 00007ffe`693b0000   C:\windows\assembly\NativeImages_v4.0.30319_64\mscorlib\ed4777cae83e1fc9087ac3dc82cf23ab\mscorlib.ni.dll
ModLoad: 00007ffe`bdee0000 00007ffe`bdf0e000   C:\windows\System32\IMM32.DLL
ModLoad: 00007ffe`bf2b0000 00007ffe`bf407000   C:\windows\System32\ole32.dll
ModLoad: 00007ffe`bcc40000 00007ffe`bcc51000   C:\windows\System32\kernel.appcore.dll
ModLoad: 00007ffe`b7660000 00007ffe`b766a000   C:\windows\SYSTEM32\VERSION.dll
ModLoad: 00007ffe`693b0000 00007ffe`69e72000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
ntdll!NtMapViewOfSection+0x14:
00007ffe`bfd7d294 c3              ret
1:001> g
ModLoad: 00007ffe`b6400000 00007ffe`b6416000   C:\windows\SYSTEM32\VCRUNTIME140_CLR0400.dll
ModLoad: 00007ffe`aa460000 00007ffe`aa51d000   C:\windows\SYSTEM32\ucrtbase_clr0400.dll
ModLoad: 00007ffe`5fa10000 00007ffe`60680000   C:\windows\assembly\NativeImages_v4.0.30319_64\System\76c2318d9c3680627b8a4a680bb84f48\System.ni.dll
(2de4.1258): Unknown exception - code 04242420 (first chance)
ModLoad: 00007ffe`71f10000 00007ffe`72104000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Drawing\ae4ddca078478b32a190cdf2c48e80f9\System.Drawing.ni.dll
ModLoad: 00007ffe`6ef60000 00007ffe`70008000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Windows.Forms\81767a18ed963e3a442c2c73684b4b28\System.Windows.Forms.ni.dll
ModLoad: 00007ffe`67db0000 00007ffe`693b0000   C:\windows\assembly\NativeImages_v4.0.30319_64\mscorlib\ed4777cae83e1fc9087ac3dc82cf23ab\mscorlib.ni.dll
ModLoad: 00007ffe`80c30000 00007ffe`80d7f000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
ntdll!NtMapViewOfSection+0x14:
00007ffe`bfd7d294 c3              ret
0:000> g
ModLoad: 00007ffe`bf2b0000 00007ffe`bf407000   C:\windows\System32\ole32.dll
ModLoad: 00000000`02d40000 00000000`02dc4000   image00000000`02d40000
ModLoad: 00000000`1b7b0000 00000000`1b834000   image00000000`1b7b0000
ModLoad: 00007ffe`5fa10000 00007ffe`60680000   C:\windows\assembly\NativeImages_v4.0.30319_64\System\76c2318d9c3680627b8a4a680bb84f48\System.ni.dll
ModLoad: 00000000`01110000 00000000`0111e000   OpenTK.GLControl.dll
ModLoad: 00000000`01120000 00000000`0112e000   OpenTK.GLControl.dll
ModLoad: 00007ffe`bcc90000 00007ffe`bcca7000   C:\windows\System32\CRYPTSP.dll
ModLoad: 00007ffe`71f10000 00007ffe`72104000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Drawing\ae4ddca078478b32a190cdf2c48e80f9\System.Drawing.ni.dll
ModLoad: 00007ffe`bbf50000 00007ffe`bbf83000   C:\windows\system32\rsaenh.dll
ModLoad: 00007ffe`bcd90000 00007ffe`bcdb6000   C:\windows\System32\bcrypt.dll
ModLoad: 00007ffe`bc5a0000 00007ffe`bc5ac000   C:\windows\SYSTEM32\CRYPTBASE.dll
ModLoad: 00007ffe`6ef60000 00007ffe`70008000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Windows.Forms\81767a18ed963e3a442c2c73684b4b28\System.Windows.Forms.ni.dll
ModLoad: 00000000`1b840000 00000000`1bdc0000   OpenTK.dll
ModLoad: 00000000`1bdc0000 00000000`1c340000   OpenTK.dll
ModLoad: 00007ffe`80c30000 00007ffe`80d7f000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
ntdll!NtMapViewOfSection+0x14:
00007ffe`bfd7d294 c3              ret
1:001> g
ModLoad: 00000000`1af50000 00000000`1afd4000   image00000000`1af50000
ModLoad: 00000000`1afe0000 00000000`1b064000   image00000000`1afe0000
ModLoad: 00000000`02640000 00000000`0264e000   OpenTK.GLControl.dll
ModLoad: 00000000`02650000 00000000`0265e000   OpenTK.GLControl.dll
ModLoad: 00007ffe`bcc90000 00007ffe`bcca7000   C:\windows\System32\CRYPTSP.dll
ModLoad: 00007ffe`bbf50000 00007ffe`bbf83000   C:\windows\system32\rsaenh.dll
ModLoad: 00007ffe`bcd90000 00007ffe`bcdb6000   C:\windows\System32\bcrypt.dll
ModLoad: 00007ffe`5ef90000 00007ffe`5fa05000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Core\8e03f9afd831af61f8413ed5a6b394cd\System.Core.ni.dll
ModLoad: 00007ffe`bc5a0000 00007ffe`bc5ac000   C:\windows\SYSTEM32\CRYPTBASE.dll
ModLoad: 00007ffe`679f0000 00007ffe`67b23000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Configuration\0230074871fa66a53c18cf61aa79cb38\System.Configuration.ni.dll
ModLoad: 00000000`1b070000 00000000`1b5f0000   OpenTK.dll
ModLoad: 00000000`1b5f0000 00000000`1bb70000   OpenTK.dll
ModLoad: 00007ffe`5c160000 00007ffe`5ca0b000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Xml\dc6e982e28f321870f322f1b3af2d83e\System.Xml.ni.dll
ModLoad: 00007ffe`bf5b0000 00007ffe`bfc98000   C:\windows\System32\shell32.dll
ModLoad: 00007ffe`bccb0000 00007ffe`bccfa000   C:\windows\System32\cfgmgr32.dll
ModLoad: 00007ffe`becd0000 00007ffe`bed77000   C:\windows\System32\shcore.dll
ModLoad: 00007ffe`bd160000 00007ffe`bd8db000   C:\windows\System32\windows.storage.dll
ModLoad: 00007ffe`bcbf0000 00007ffe`bcc13000   C:\windows\System32\profapi.dll
ModLoad: 00007ffe`bcba0000 00007ffe`bcbea000   C:\windows\System32\powrprof.dll
ModLoad: 00007ffe`bcb90000 00007ffe`bcba0000   C:\windows\System32\UMPDC.dll
ModLoad: 00007ffe`5ef90000 00007ffe`5fa05000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Core\8e03f9afd831af61f8413ed5a6b394cd\System.Core.ni.dll
ModLoad: 00007ffe`679f0000 00007ffe`67b23000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Configuration\0230074871fa66a53c18cf61aa79cb38\System.Configuration.ni.dll
ModLoad: 00007ffe`ba840000 00007ffe`ba8d9000   C:\windows\system32\uxtheme.dll
ModLoad: 00007ffe`b2290000 00007ffe`b2339000   C:\windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.18362.1379_none_73b5a52ad813d2b1\comctl32.dll
ModLoad: 00007ffe`5c160000 00007ffe`5ca0b000   C:\windows\assembly\NativeImages_v4.0.30319_64\System.Xml\dc6e982e28f321870f322f1b3af2d83e\System.Xml.ni.dll
ModLoad: 00007ffe`bf5b0000 00007ffe`bfc98000   C:\windows\System32\shell32.dll
ModLoad: 00007ffe`bccb0000 00007ffe`bccfa000   C:\windows\System32\cfgmgr32.dll
ModLoad: 00007ffe`becd0000 00007ffe`bed77000   C:\windows\System32\shcore.dll
ModLoad: 00007ffe`bd160000 00007ffe`bd8db000   C:\windows\System32\windows.storage.dll
ModLoad: 00007ffe`bcbf0000 00007ffe`bcc13000   C:\windows\System32\profapi.dll
ModLoad: 00007ffe`bcba0000 00007ffe`bcbea000   C:\windows\System32\powrprof.dll
ModLoad: 00007ffe`bcb90000 00007ffe`bcba0000   C:\windows\System32\UMPDC.dll
ModLoad: 00007ffe`ba840000 00007ffe`ba8d9000   C:\windows\system32\uxtheme.dll
ModLoad: 00007ffe`b2290000 00007ffe`b2339000   C:\windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.18362.1379_none_73b5a52ad813d2b1\comctl32.dll
ModLoad: 00007ffe`b14f0000 00007ffe`b1696000   C:\windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.1379_none_cf6ae6993eef3a92\gdiplus.dll
ModLoad: 00007ffe`be9f0000 00007ffe`beb25000   C:\windows\System32\MSCTF.dll
ModLoad: 00007ffe`bf4e0000 00007ffe`bf5a5000   C:\windows\System32\OLEAUT32.dll
ModLoad: 00007ffe`b14f0000 00007ffe`b1696000   C:\windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.1379_none_cf6ae6993eef3a92\gdiplus.dll
ModLoad: 00007ffe`be9f0000 00007ffe`beb25000   C:\windows\System32\MSCTF.dll
ModLoad: 00007ffe`bf4e0000 00007ffe`bf5a5000   C:\windows\System32\OLEAUT32.dll
ModLoad: 00007ffe`a1f70000 00007ffe`a20c6000   C:\windows\SYSTEM32\OPENGL32.DLL
ModLoad: 00007ffe`b7350000 00007ffe`b737c000   C:\windows\SYSTEM32\GLU32.dll
ModLoad: 00007ffe`bb6f0000 00007ffe`bb710000   C:\windows\SYSTEM32\dxcore.dll
(601c.3670): C++ EH exception - code e06d7363 (first chance)
(601c.3670): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffe`a3980000 00007ffe`a3c7e000   C:\windows\SYSTEM32\DWrite.dll
ModLoad: 00007ffe`a1f70000 00007ffe`a20c6000   C:\windows\SYSTEM32\OPENGL32.DLL
ModLoad: 00007ffe`b7350000 00007ffe`b737c000   C:\windows\SYSTEM32\GLU32.dll
ModLoad: 00007ffe`bb6f0000 00007ffe`bb710000   C:\windows\SYSTEM32\dxcore.dll
(2de4.1258): C++ EH exception - code e06d7363 (first chance)
(2de4.1258): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffe`a3980000 00007ffe`a3c7e000   C:\windows\SYSTEM32\DWrite.dll
ModLoad: 00007ffe`3f230000 00007ffe`41908000   C:\windows\System32\DriverStore\FileRepository\nvsm.inf_amd64_4f45c68d3a75c0b1\nvoglv64.dll
ModLoad: 00007ffe`bee00000 00007ffe`bf270000   C:\windows\System32\SETUPAPI.dll
ModLoad: 00007ffe`b8340000 00007ffe`b8353000   C:\windows\SYSTEM32\WTSAPI32.dll
ModLoad: 00007ffe`3f230000 00007ffe`41908000   C:\windows\System32\DriverStore\FileRepository\nvsm.inf_amd64_4f45c68d3a75c0b1\nvoglv64.dll
ModLoad: 00007ffe`bee00000 00007ffe`bf270000   C:\windows\System32\SETUPAPI.dll
ModLoad: 00007ffe`b8340000 00007ffe`b8353000   C:\windows\SYSTEM32\WTSAPI32.dll
ModLoad: 00007ffe`bc970000 00007ffe`bc99a000   C:\windows\SYSTEM32\DEVOBJ.dll
ModLoad: 00007ffe`bd9e0000 00007ffe`bda3c000   C:\windows\System32\WINTRUST.dll
ModLoad: 00007ffe`bcc20000 00007ffe`bcc32000   C:\windows\System32\MSASN1.dll
ModLoad: 00007ffe`bcdc0000 00007ffe`bcf0a000   C:\windows\System32\CRYPT32.dll
ModLoad: 00007ffe`bbbd0000 00007ffe`bbc01000   C:\windows\SYSTEM32\ntmarta.dll
ModLoad: 00007ffe`bc970000 00007ffe`bc99a000   C:\windows\SYSTEM32\DEVOBJ.dll
ModLoad: 00007ffe`bd9e0000 00007ffe`bda3c000   C:\windows\System32\WINTRUST.dll
ModLoad: 00007ffe`bcc20000 00007ffe`bcc32000   C:\windows\System32\MSASN1.dll
ModLoad: 00007ffe`bcdc0000 00007ffe`bcf0a000   C:\windows\System32\CRYPT32.dll
ModLoad: 00007ffe`bbbd0000 00007ffe`bbc01000   C:\windows\SYSTEM32\ntmarta.dll
ModLoad: 00007ffe`bae80000 00007ffe`baead000   C:\windows\SYSTEM32\dwmapi.dll
ModLoad: 00007ffe`bae80000 00007ffe`baead000   C:\windows\SYSTEM32\dwmapi.dll
ModLoad: 00007ffe`91a90000 00007ffe`91d3e000   C:\windows\system32\nvspcap64.dll
ModLoad: 00007ffe`91a90000 00007ffe`91d3e000   C:\windows\system32\nvspcap64.dll
ModLoad: 00007ffe`bbc70000 00007ffe`bbcc6000   C:\windows\SYSTEM32\WINSTA.dll
ModLoad: 00007ffe`bbc70000 00007ffe`bbcc6000   C:\windows\SYSTEM32\WINSTA.dll
(2de4.1258): CLR exception - code e0434352 (first chance)
(601c.3670): CLR exception - code e0434352 (first chance)
(2de4.1258): CLR exception - code e0434352 (first chance)
(601c.3670): CLR exception - code e0434352 (first chance)
(2de4.1258): CLR exception - code e0434352 (first chance)
(601c.3670): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffe`a9390000 00007ffe`a942d000   C:\windows\System32\TextInputFramework.dll
ModLoad: 00007ffe`ba110000 00007ffe`ba1e4000   C:\windows\System32\CoreMessaging.dll
ModLoad: 00007ffe`a8840000 00007ffe`a8b6a000   C:\windows\System32\CoreUIComponents.dll
ModLoad: 00007ffe`b8890000 00007ffe`b89e2000   C:\windows\SYSTEM32\wintypes.dll
ModLoad: 00000000`25b50000 00000000`25ca2000   C:\windows\SYSTEM32\wintypes.dll
ModLoad: 00000000`22a10000 00000000`22b62000   C:\windows\SYSTEM32\wintypes.dll
ModLoad: 00007ffe`ae360000 00007ffe`ae607000   C:\windows\System32\iertutil.dll
(601c.3670): Stack overflow - code c00000fd (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
00007ffe`09eb373d f3ab            rep stos dword ptr [rdi]

For whatever they're worth, the console printouts:
Quote
-> using BufferedImage
BufferedImageBuffer.getPixels()
Software renderer (OpenGL mode) initialized
Using LWJGL's AWTGLCanvas
execute(int, object[]): Parameters null? False Init? False MODE_RETURN_CANVAS: 11
Software renderer disposed
Loading Texture...numbers.jpg
Texture.loadTexture(string filename, FileStream inStream, Image img, bool alpha): Parameter is not valid.
[ 2/22/2021 3:56:59 AM ] - ERROR: File not found - replacement texture used instead!
Loading Texture...EarthTexture.png
Texture.loadTexture(string filename, FileStream inStream, Image img, bool alpha): Parameter is not valid.
[ 2/22/2021 3:56:59 AM ] - ERROR: File not found - replacement texture used instead!
Loading Texture...DarthVader.png
Texture.loadTexture(string filename, FileStream inStream, Image img, bool alpha): Parameter is not valid.
[ 2/22/2021 3:56:59 AM ] - ERROR: File not found - replacement texture used instead!
Adding Lightsource: 0
Vader texture ID: 2
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
GL_ARB_texture_env_combine supported and used!
FBO not supported or disabled!
VBO not supported or disabled!
OpenGL renderer initialized (using 4 texture stages)
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
execute(int, object[]): Parameters null? True Init? False MODE_SWAP_BUFFERS: 1
AWTDisplayList.switchBuffers(): count: 2, Is vl[1] null? True
ThreeDCanvas.switchList() completing.
execute(int, object[]): Parameters null? False Init? False MODE_CLEAR: 2
execute(int, object[]): Parameters null? False Init? False MODE_BLIT_TEXTURE: 4
Title: Re: Cpct?
Post by: EgonOlsen on February 22, 2021, 08:47:01 am
How can Microsoft still be so bad with giving proper error messages? That doesn't help at all. The log output looks fine as well, as far as I can tell. I'm not sure, what's going on there. Does this problem occur immediately or after some time or do you have to trigger it somehow?
Title: Re: Cpct?
Post by: AGP on February 22, 2021, 03:04:38 pm
It happens immediately. No rendering, or even clearing, gets done.
Title: Re: Cpct?
Post by: EgonOlsen on February 23, 2021, 09:00:33 am
So maybe it's just something that you are calling recursively by accident? Something like

Code: [Select]
callMe() {
    // callMe(null); // What you are supposed to call
    callMe(); // What you actually call by accident

}

callMe(SomeStuff stf) {
    ......
}


I tend to do these things when refactoring code, hence the idea.
Title: Re: Cpct?
Post by: AGP on February 25, 2021, 01:50:34 am
I'm not doing recursion in my code. I thought maybe you had it somewhere I missed.

At any rate, I'm now porting the Worker class in an effort to fix the lighting annoyance in the SoftGLRenderer, and I came across a Thread.MAX_PRIORITY-1 assignment. MAX_PRIORITY is 10, NORM_PRIORITY is 5, and MIN_PRIORITY IS 1. So what's 9 about?
Title: Re: Cpct?
Post by: EgonOlsen on February 26, 2021, 08:37:43 am
I wanted to give it a quite high priority, but not 10. If you use 10, older machines tended to execute nothing else anymore but this thread. 9 was a good compromise at the time. Today, it might not be even be needed and it might be a better idea to leave thread priorities alone anyway.
Title: Re: Cpct?
Post by: AGP on March 05, 2021, 09:17:46 am
OK, now AWTGLRenderer is stuck on MODE_GRAB_SCREEN. Note that at the very beginning the frame's OnPaint() gets called and completes once. Then we get a lot of drawWireframe calls, followed by infinite MODE_GRAB_SCREENs.

Quote
ThreedCanvas.OnPaint()
ThreedCanvas.OnPaint(): Finished painting. Swapping buffers. onceList.count: 0
ThreedCanvas.OnPaint()
AWTGLRenderer.executeGL():  MODE_CLEAR: 2
AWTGLRenderer.executeGL():  MODE_SET_CAMERA: 21
AWTGLRenderer.executeGL():  MODE_SET_FRUSTUM: 0
AWTGLRenderer.executeGL():  MODE_REINIT: 23
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
drawWireframe(AWTDisplayList list, int ind): drawing with color: 255, 255, 0
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
Expanding command queue to 2000 entries!
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
AWTGLRenderer.executeGL():  MODE_GRAB_SCREEN: 6
Title: Re: Cpct?
Post by: EgonOlsen on March 05, 2021, 01:56:19 pm
Grabbing the screen rendered by the AWTGLRenderer is a bit of a pain anyway, because the calling thread (the one that want to grab the image) has to trigger a repaint and then wait for the paint thread to do that. I'm not sure how this should result in an endless list of calls though. Check what happens in the AWTGLRenderer's waitForPainting() method. Maybe canvas.isVisible() returns always false in your implementation or something like that.
Title: Re: Cpct?
Post by: AGP on March 23, 2021, 06:35:12 pm
I'm drawing again, albeit very weird shapes (even when I created an Object3D made up of a single triangle) with AWTGLRenderer. I've noticed that you call GL.VertexPointer(), as opposed to something like GL.GenBuffer() and GL.BindVertexArray(). Is there a reason for this or is that an OpenGL version thing? Should I try the latter or is that somehow wrong in the context of the engine?
Title: Re: Cpct?
Post by: EgonOlsen on March 23, 2021, 11:13:07 pm
Glvertexpointer just defines the format of the vertices in the array, not the array itself. This has to be done somehow, I don't see why it should be an issue here.
Title: Re: Cpct?
Post by: AGP on March 24, 2021, 12:42:32 am
GL.VertexPointer must be called, you mean? Because createVertexArrays() doesn't call GL.BufferData(BufferTarget.ArrayBuffer, vertices.Length * sizeof(float), vertices, BufferUsageHint.StaticDraw). Should that not also be done? Put differently: where do you tell OpenGL to use the vertices object if not with VertexPointer()?
Title: Re: Cpct?
Post by: EgonOlsen on March 24, 2021, 07:12:20 am
My bad. It also sets the pointer to the array in use. But there are no calls to bind any buffers in this case, because there are no buffers. You have to distinguish between the "normal" render pipeline and the compiled one. The compiled one uses buffers and such but the "normal" one just fills the arrays and renders them directly via glDrawArrays.

You can try to set Config.glVertexArrays to false and revert drawing to individual draw calls for each polygon. If this changes something, your vertex array handling is off. If it doesn't, something else is wrong.
Title: Re: Cpct?
Post by: AGP on March 25, 2021, 03:04:28 am
Look at how strange this is: renderVertexArray(), before one of its many vertPos = 0 calls, prints this even as the very wrong shapes are drawn on the screen. Model being tested here is a simple Primitives.getSphere(20f) (I'm not even sure the 9 vertices is right for a sphere).
Code: [Select]
Logger.log("renderVertexArray(): number of vertices to draw: "+vertPos +", curPos: "+curPos);
Quote
renderVertexArray(): number of vertices to draw: 9, curPos: 3
renderVertexArray(): number of vertices to draw: 0, curPos: 0
renderVertexArray(): number of vertices to draw: 0, curPos: 0
renderVertexArray(): number of vertices to draw: 0, curPos: 0
renderVertexArray(): number of vertices to draw: 0, curPos: 0
...

By the way, a guy at the Android board says he's using version 1.32. Do you have different versions for PC and Android (because I thought we were at 1.31)?
Title: Re: Cpct?
Post by: EgonOlsen on March 25, 2021, 08:09:36 am
9 vertices isn't right for a sphere. In uncompiled rendering mode, the number of vertices in one batch is dynamic but 9 for a uniformly textured sphere seems off.

I've released 1.32 yesterday. It has been available for quite some time as a beta release linked to from several threads. The version number is the same between desktop and android.
Title: Re: Cpct?
Post by: AGP on March 25, 2021, 08:22:44 am
Seemed way too small a number to me as well. Do you understand that printout (note that what I interpreted as number of vertices was vertPos)?
Title: Re: Cpct?
Post by: EgonOlsen on March 25, 2021, 08:47:26 am
vertPos is only used for blitting, IIRC. Its value shouldn't matter here. The drawing actually happens from 0 to curPos.
Title: Re: Cpct?
Post by: AGP on March 25, 2021, 09:00:59 am
How do I get the number of vertices from inside the AWTGLRenderer, then? I know how to do it with World, Mesh, etc. but I really want to see what AWTGLRenderer has to identify the current problem.
Title: Re: Cpct?
Post by: EgonOlsen on March 25, 2021, 01:27:30 pm
It's curPos. The normal rendering mode (i.e. not for compiled objects) fill a given vertex array from 0 to <some vertex count> and renders that in one batch. How much it fills, depends on the object. If the object is uniformly textured (i.e. it uses the same texture(s) for each polygon), this value should be somewhere near the maximum size of that vertex array.

Have you tried what happens if you disable vertex arrays in the config? If that still renders junk, your problem isn't in the rendering but somewhere before.
Title: Re: Cpct?
Post by: AGP on March 25, 2021, 06:02:38 pm
It renders junk with vertex arrays, and it renders nothing if glVertexArrays is set to false.
Title: Re: Cpct?
Post by: EgonOlsen on March 25, 2021, 06:18:12 pm
It really looks like as if your geometry is wrong in the first place. Either that, or the conversion into GL format is faulty. In that case, it should at least render fine when using the software renderer. Does it?
Title: Re: Cpct?
Post by: AGP on March 25, 2021, 06:30:17 pm
Yes, I had to do that lighting hack on the 1.31 port (one or two of the light multipliers were always 0) but otherwise the SoftGLRenderer renders perfectly. And as I said, the current model being tested is from Primitives.
Title: Re: Cpct?
Post by: EgonOlsen on March 25, 2021, 06:51:13 pm
I'm sure the model is fine, if it renders in software. But maybe your conversion into GL coordinate system is buggy?
Title: Re: Cpct?
Post by: AGP on March 25, 2021, 09:00:00 pm
The reason that I don't think that that's it, other than the fact that I didn't change what you did, is that no matter what model I test this is what I get:
https://www.youtube.com/watch?v=Pfuo77vKUbo (https://www.youtube.com/watch?v=Pfuo77vKUbo)
Title: Re: Cpct?
Post by: EgonOlsen on March 25, 2021, 09:55:31 pm
No, that doesn't look like a problem in the model's setup...at least not as the sole reason of the problem. But it's actually impossible to tell what's going on there. Maybe some other GL setup going wrong, but it will be quite hard to find out. I would add a log output to every GL call in the Java version and then compare the trace that this produces with the same thing taken from the C# version while rendering the exact same scene. And then see, if there is a difference between the calls that these versions do. It will be quite a lot of work, I suppose, but you need some kind of reference to track this down and currently, you have none.
Title: Re: Cpct?
Post by: AGP on April 09, 2021, 09:47:21 am
The GLRenderer (not yet the AWT) is working! Yay.
Title: Re: Cpct?
Post by: EgonOlsen on April 12, 2021, 03:41:15 pm
Good to hear that!
Title: Re: Cpct?
Post by: AGP on April 18, 2021, 11:55:46 pm
My big stress test case is only clearing the screen. The same forest model renders on a model tester if and only if glVertexArrays is set to false. On the stress test, with a player, two skyboxes and some NPCs even without vertex arrays nothing gets drawn. But wireframe always works, on both the loader and the stress test, whether or not vertex arrays are being used. I'm not sure how helpful the following printout will be, but I feel like renderVertexArray(int) should be printing contiguous numbers.

Code: [Select]
renderVertexArray(int): 3
renderVertexArray(int): 3
renderVertexArray(int): 3
renderVertexArray(int): 9
renderVertexArray(int): 51
renderVertexArray(int): 30
renderVertexArray(int): 120
renderVertexArray(int): 18
renderVertexArray(int): 120
renderVertexArray(int): 12
renderVertexArray(int): 120
renderVertexArray(int): 12
renderVertexArray(int): 6
renderVertexArray(int): 6
renderVertexArray(int): 3
renderVertexArray(int): 6
renderVertexArray(int): 6
renderVertexArray(int): 6
renderVertexArray(int): 6
renderVertexArray(int): 15
renderVertexArray(int): 3
renderVertexArray(int): 9
renderVertexArray(int): 3
renderVertexArray(int): 435
renderVertexArray(int): 51
renderVertexArray(int): 48
renderVertexArray(int): 3
renderVertexArray(int): 12
renderVertexArray(int): 3
renderVertexArray(int): 6
renderVertexArray(int): 3
renderVertexArray(int): 30
renderVertexArray(int): 3
renderVertexArray(int): 159
renderVertexArray(int): 3
renderVertexArray(int): 9
renderVertexArray(int): 3
renderVertexArray(int): 18
renderVertexArray(int): 3
renderVertexArray(int): 279
renderVertexArray(int): 18
renderVertexArray(int): 24
renderVertexArray(int): 12
renderVertexArray(int): 18
renderVertexArray(int): 3
renderVertexArray(int): 36
renderVertexArray(int): 18
renderVertexArray(int): 36
renderVertexArray(int): 18
renderVertexArray(int): 24
renderVertexArray(int): 81
renderVertexArray(int): 3
renderVertexArray(int): 3
renderVertexArray(int): 9
renderVertexArray(int): 15
renderVertexArray(int): 6
renderVertexArray(int): 6
renderVertexArray(int): 6
renderVertexArray(int): 3
renderVertexArray(int): 6
renderVertexArray(int): 12
renderVertexArray(int): 12
renderVertexArray(int): 18
renderVertexArray(int): 225
renderVertexArray(int): 3
renderVertexArray(int): 186
renderVertexArray(int): 3
renderVertexArray(int): 12
renderVertexArray(int): 6
renderVertexArray(int): 69
renderVertexArray(int): 168
renderVertexArray(int): 18
renderVertexArray(int): 444
renderVertexArray(int): 6
renderVertexArray(int): 15
renderVertexArray(int): 3
renderVertexArray(int): 3
renderVertexArray(int): 36
renderVertexArray(int): 240
renderVertexArray(int): 3
renderVertexArray(int): 6
renderVertexArray(int): 3
renderVertexArray(int): 3
renderVertexArray(int): 6
renderVertexArray(int): 12
renderVertexArray(int): 456
renderVertexArray(int): 21
Title: Re: Cpct?
Post by: EgonOlsen on April 19, 2021, 07:41:28 am
I'm not sure what this number represents, but if it's the size, it might not be unreasonable, if you have many smaller models and/or smaller parts of the model that are using different textures.
Title: Re: Cpct?
Post by: AGP on April 19, 2021, 07:51:56 am
But what does it tell you that when this complex forest model gets drawn it is only when vertex arrays are disabled? Also, why do wireframes always work?
Title: Re: Cpct?
Post by: EgonOlsen on April 19, 2021, 02:56:56 pm
Most likely that something is wrong with your vertex array setup and/or rendering code. Wireframe rendering are just simple call to glVertex3f, which draw one line at a time. Everything else is more complex, so there is an increased chance of getting it wrong at some stage.
Title: Re: Cpct?
Post by: AGP on April 19, 2021, 07:42:00 pm
But is it possible to have a mistake in the code and still have it sometimes work (a single bush from that forest will render without hitch with vertex arrays)?
Title: Re: Cpct?
Post by: EgonOlsen on April 20, 2021, 07:29:02 am
Yes. OpenGL is a state machine. Maybe the state is correct for this one bush and gets screwed up afterwards.
Title: Re: Cpct?
Post by: AGP on April 20, 2021, 07:46:54 am
I'm porting GLSLShader and ShadowHelper right now. Around line 382, ShadowHelper does world.setAmbientLight(col.getRed(), col.getRed(), col.getBlue()). Is that a bug or did you use red twice on purpose?
Title: Re: Cpct?
Post by: EgonOlsen on April 20, 2021, 09:09:54 am
Opps, no....that's supposed to be col.getGreen(). The Android version does is correctly though.
Title: Re: Cpct?
Post by: AGP on April 22, 2021, 09:01:40 pm
This is what my renderVertexArray(int) method looks like, because I couldn't find OpenTK equivalents for the ARBMultitexture stuff. Could that be the problem?

Code: [Select]
       private void renderVertexArray(int curPos) {
              if (curPos != 0) {
                     bool dissed = false;
                     // For Projective the texture coordinates from ...
                     for (int i = 0; i < projective.Length; i++) {
                            if (projective[i] && buffersEnabled[i]) {
//                                   ARBMultitexture.glClientActiveTextureARB(stageMap[i]);
                                   GL.DisableClientState(ArrayCap.TextureCoordArray);
                                   dissed = true;
                            }
                     }
                     GL.DrawArrays(PrimitiveType.Triangles, 0, curPos);
                     if (dissed) {
                            // And on again if required. Actually, this should be dead, but you are not in the driver.
                            for (int i = 0; i < projective.Length; i++) {
                                   if (projective[i] && buffersEnabled[i]) {
//                                          ARBMultitexture.glClientActiveTextureARB(stageMap[i]);
                                          GL.EnableClientState(ArrayCap.TextureCoordArray);
                                   }
                            }
                     }
              }
       }
Title: Re: Cpct?
Post by: EgonOlsen on April 23, 2021, 07:25:39 am
I'm not sure what you mean, because there is ARBMultitexture-stuff in your code anyway. However, it might be worth a try and see if your constants are the same as they are in normal OpenGL. These should just be integers and if your toolkit isn't doing something really strange with them, something like PrimitiveType.Triangles should have the same value as OpenGL's GL_TRIANGLES.
Title: Re: Cpct?
Post by: AGP on April 23, 2021, 07:50:28 am
The ARBMultitexture lines are commented out in the above code. But I found GL.ActiveTexture((TextureUnit)stageMap), which I hope is the same. Still, no progress on the vertex array problem. As for PrimtiveType.Triangles, I'm confident about it.
Title: Re: Cpct?
Post by: EgonOlsen on April 23, 2021, 09:18:32 am
I see...it shouldn't matter much though, because it's only used for projective texturing, which in most cases, you don't need unless you are using shadow mapping and, well, projective textures.
Title: Re: Cpct?
Post by: AGP on May 19, 2021, 12:51:53 am
Our little engine has a very specific approach to OpenGL, so online examples aren't always very helpful. I have found the following answer (https://stackoverflow.com/questions/61030683/opengl-opentk-drawing-with-indices-attempted-to-read-or-write-protected-memo (https://stackoverflow.com/questions/61030683/opengl-opentk-drawing-with-indices-attempted-to-read-or-write-protected-memo)) to a similar problem, but I can't fit it into the pipeline. GLRenderer.renderVertexArray(int) is currently throwing:
Quote
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at OpenTK.Graphics.OpenGL.GL.DrawArrays(PrimitiveType mode, Int32 first, Int32 count)
   at co.ratto.threed.GLRenderer.renderVertexArray(Int32 curPos)
   at co.ratto.threed.GLRenderer.drawVertexArray(VisList visList, Int32 start, Int32 end, FrameBuffer buffer, World world)
   at co.ratto.threed.World.draw(FrameBuffer buffer, Boolean wireframe, UInt32 frameColor, Int32 start, Int32 end)
   at co.ratto.threed.World.draw(FrameBuffer buffer, Boolean wireframe, UInt32 frameColor)
   at co.ratto.threed.World.draw(FrameBuffer buffer)
   at co.ratto.threed.SkyBox.render(World world, FrameBuffer buffer)
   at LivingForest.draw()
   at LivingForest.gameLoop()
   at LivingForest.OnUpdateFrame(FrameEventArgs e)
   at OpenTK.GameWindow.RaiseUpdateFrame(Stopwatch watch, Double elapsed, Double& timestamp)
   at OpenTK.GameWindow.DispatchUpdateFrame(Stopwatch watch)
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at LivingForest..ctor()
   at LivingForest.Main(String[] args)

And this is my port (almost identical to yours):
Code: [Select]
       private void createVertexArrays(int max) {
              GL.EnableClientState(ArrayCap.TextureCoordArray);
              for (int i = 0; i < max; i++) {
                     multiTextures[i] = new FloatBuffer(VertexArraySize * 2);
                     GL.ActiveTexture((TextureUnit)stageMap[i]);
                     GL.TexCoordPointer(2, TexCoordPointerType.Float, 8, multiTextures[i].array);
                     if (i == 0) {
                            textures = multiTextures[0];
                            buffersEnabled[0] = true;
                     }
              }
       }
       private void renderVertexArray(int curPos) {
              if (curPos != 0) {
                     bool dissed = false;
                     // For Projective the Texture Coordinates from ...
                     for (int i = 0; i < projective.Length; i++) {
                            if (projective[i] && buffersEnabled[i]) {
                                   GL.ActiveTexture((TextureUnit)stageMap[i]);
                                   GL.DisableClientState(ArrayCap.TextureCoordArray);
                                   dissed = true;
                            }
                     }
                     GL.DrawArrays(PrimitiveType.Triangles, 0, curPos);
                     if (dissed) {
                            // And on again if necessary. Actually, that should be dead, but you are not in it in the driver.
                            for (int i = 0; i < projective.Length; i++) {
                                   if (projective[i] && buffersEnabled[i]) {
                                          GL.ActiveTexture((TextureUnit)stageMap[i]);
                                          GL.EnableClientState(ArrayCap.TextureCoordArray);
                                   }
                            }
                     }
              }
       }

If you have any insights I would greatly appreciate them.
Title: Re: Cpct?
Post by: AGP on May 19, 2021, 09:24:42 am
Never mind that. After too long with no success, I've started rendering things beautifully. A lot of different problems at the moment, like the fact that no compiled object is working. Only so many blitting methods work at all, for that matter, maxPolysVisible can't be much more than 512k for some reason, and a few other mysteries.

Oh, and C# can't catch exceptions across threads, which is a nuisance. I may have to switch to Tasks, if that's doable.
Title: Re: Cpct?
Post by: AGP on June 25, 2021, 09:24:33 am
I think that I've figured out my problem with CompiledInstance memory errors: I had to delete the reflection (I really wish you would forget Java 1.1 ever existed), and I can't see how your code ever calls Object3DCompiler.compile(...) (or Versionhelper5.compile(...) for that matter). Help me out?
Title: Re: Cpct?
Post by: EgonOlsen on June 28, 2021, 07:34:05 am
It's called from within World.compile(), which you can most likely ignore, because it's only relevant if you call World.compileAllObjects() and from within WorldProcessor.processInternal(), which is the "normal" way.
Title: Re: Cpct?
Post by: AGP on June 28, 2021, 07:44:50 pm
I put in a bizarre wait of 2.5 seconds and cleared that block as far is this bit. Now, no matter what I try indices is null. What I'm trying is hacky, anyway, so I'd rather ask you when indices in CompiledInstance.renderVBO() might be null. The C# runtime operates very differently from the JVM.

Code: [Select]
              do {
                     if (indexed) {
                            GL.BindBuffer(BufferTarget.ElementArrayBuffer, indicesId);
                                   System.Console.WriteLine("CompiledInstance.renderVBO(): Is indices null? "+(indices==null));
                                          if (indices==null){
                                                 indices = new IntBuffer(tris.Count * 3);
                                                 //return;
                                                 while (indices == null)
                                                 continue;}
                            GL.DrawElements(primitiveType, indexCount, DrawElementsType.UnsignedInt, indices.array);
                                   System.Console.WriteLine("CompiledInstance.renderVBO(): BindBuffer()?");
                            GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);
                     } else {
                            System.Console.WriteLine("\n\nCompiledInstance.renderVBO(): GL.DrawArrays(...).\n");
                            GL.DrawArrays(primitiveType, 0, cnt);
                     }
              }
Title: Re: Cpct?
Post by: EgonOlsen on June 29, 2021, 07:41:40 am
Indices can be null, if the object in question hasn't been compiled with indexed geometry. This should only be the case if the object is a dynamic one (i.e. animated or has an attribute list attached to it or a vertex controller). Or you can force non-indexed compilation by using the corresponding build() call.

However, if the indexed flag in a compiled instance is true, indices can't be null unless you did something wrong when compiling the object.
Title: Re: Cpct?
Post by: AGP on July 04, 2021, 07:54:37 am
It's infuriating that although I don't know why the indexed flag is true, the following block produces the following output. I don't suppose anyone would have any insights here?

Code: [Select]
              do {
                     if (indexed) {
                            GL.BindBuffer(BufferTarget.ElementArrayBuffer, indicesId);
                                   System.Console.WriteLine("CompiledInstance.renderVBO(): Is indices null? "+(indices==null));
                                   if (indices==null){
                                          indexed = false;//A HACK
                                                               System.Console.WriteLine("HACKHACKHACKHACKHACKHACK");
                                                 indices = new IntBuffer(tris.Count * 3);
                                   return;}
                            if (indexed){//A HACK
                            GL.DrawElements(primitiveType, indexCount, DrawElementsType.UnsignedInt, indices.array);
                                   System.Console.WriteLine("CompiledInstance.renderVBO(): BindBuffer()?");
                            GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);}
                     } else {
                            System.Console.WriteLine("\n\nCompiledInstance.renderVBO(): GL.DrawArrays(...).\n");
                            GL.DrawArrays(primitiveType, 0, cnt);
                     }
              }

Quote
CompiledInstance.renderVBO(): Is indices null? True
HACKHACKHACKHACKHACKHACK

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at co.ratto.threed.CompiledInstance.renderVBO(Boolean vertexAlpha, IRenderHook hook)
   at co.ratto.threed.CompiledInstance.render(Int32 myID, IRenderer renderer, Single[] ambient, Single[] cols, Boolean intoDepthMap, Camera cam, Single[][] lights, Boolean wireFrame, Object[] data)
   at co.ratto.threed.GLRenderer.drawVertexArray(VisList visList, Int32 start, Int32 end, FrameBuffer buffer, World world)
   at co.ratto.threed.World.draw(FrameBuffer buffer, Boolean wireframe, UInt32 frameColor, Int32 start, Int32 end)
   at co.ratto.threed.World.draw(FrameBuffer buffer, Boolean wireframe, UInt32 frameColor)
   at co.ratto.threed.World.draw(FrameBuffer buffer)
   at co.ratto.threed.SkyBox.render(World world, FrameBuffer buffer)
   at LivingForest.draw()
   at LivingForest.gameLoop()
   at LivingForest.OnUpdateFrame(FrameEventArgs e)
   at OpenTK.GameWindow.RaiseUpdateFrame(Stopwatch watch, Double elapsed, Double& timestamp)
   at OpenTK.GameWindow.DispatchUpdateFrame(Stopwatch watch)
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at LivingForest..ctor()
   at LivingForest.Main(String[] args)
Title: Re: Cpct?
Post by: EgonOlsen on July 04, 2021, 10:32:33 am
What's the actual line that throws this exception? The stack trace doesn't tell... ???
Title: Re: Cpct?
Post by: AGP on July 04, 2021, 07:33:33 pm
It has to be GL.DrawElements(primitiveType, indexCount, DrawElementsType.UnsignedInt, indices.array) because there's a printout right after it that doesn't get printed.
Title: Re: Cpct?
Post by: EgonOlsen on July 05, 2021, 10:39:56 am
Ok. Have you tried to output everything that goes into that method? Maybe something other is null than the indices themselves.
Title: Re: Cpct?
Post by: AGP on July 07, 2021, 09:19:51 am
Yeah, I added a try-catch to the entire method. It gets me through initialization, then it stops happening. Still, I'm not getting anything drawn when compiling the objects.