Main Menu

Cpct?

Started by AGP, September 16, 2019, 06:45:59 PM

Previous topic - Next topic

AGP

AWTGLRenderer. init((int, int, int, int, int) is being called, but not the real one.

EgonOlsen

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.

AGP

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().

EgonOlsen

These three references do...(see attachment).

AGP

Thank you. I manually called init(...), but now I'm getting a black screen.

The following code
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?

EgonOlsen

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:

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.

AGP

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

EgonOlsen

No idea what it's drawing there. What it is supposed to be?

AGP

Hahah, it's supposed to be Vader (at exactly this lighting and distance):

https://www.dropbox.com/s/2ch8ajcin5ukdm3/SupposedToBe.png?dl=0

EgonOlsen

Have you tried something simple, like a box or a sphere? Do those render correctly?

AGP

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).

EgonOlsen

It that a compiled object or not? Either way, have to tried the opposite?

AGP

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)?

EgonOlsen

That's default behaviour, because it's usually the fastest way to do it (apart from compiling objects). You can disable it by setting:

Config.glVertexArrays=false;

AGP

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?).