Author Topic: Cpct?  (Read 14281 times)

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #45 on: December 04, 2020, 09:41:36 pm »
AWTGLRenderer. init((int, int, int, int, int) is being called, but not the real one.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #46 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.

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #47 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().

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #48 on: December 05, 2020, 08:21:49 pm »
These three references do...(see attachment).

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #49 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #50 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.

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #51 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #52 on: December 18, 2020, 12:24:22 pm »
No idea what it's drawing there. What it is supposed to be?

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #53 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #54 on: December 19, 2020, 03:13:56 pm »
Have you tried something simple, like a box or a sphere? Do those render correctly?

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #55 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).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #56 on: December 21, 2020, 10:23:12 am »
It that a compiled object or not? Either way, have to tried the opposite?

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #57 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)?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12221
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #58 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;

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #59 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?).