Author Topic: Cpct?  (Read 15363 times)

Offline EgonOlsen

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

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #106 on: March 25, 2021, 06:02:38 pm »
It renders junk with vertex arrays, and it renders nothing if glVertexArrays is set to false.

Offline EgonOlsen

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

Offline AGP

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

Offline EgonOlsen

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

Offline AGP

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

Offline EgonOlsen

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

Offline AGP

  • quad
  • ******
  • Posts: 1719
    • View Profile
Re: Cpct?
« Reply #112 on: April 09, 2021, 09:47:21 am »
The GLRenderer (not yet the AWT) is working! Yay.
« Last Edit: April 09, 2021, 10:02:52 pm by AGP »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12241
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #113 on: April 12, 2021, 03:41:15 pm »
Good to hear that!

Offline AGP

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

Offline EgonOlsen

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

Offline AGP

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

Offline EgonOlsen

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

Offline AGP

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

Offline EgonOlsen

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