Author Topic: Cpct?  (Read 46658 times)

Offline EgonOlsen

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

Offline AGP

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

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #137 on: August 02, 2021, 10:12:49 pm »
On occasions whose particularities I've yet to identify, I can't get rid of the following message.

Quote
WARNING: World.renderScene(): There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of BR3D objects on a thread different from the rendering thread! Is camera null? False Is visList? False

Also, only the Skybox renders when compiled...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #138 on: August 03, 2021, 01:49:18 pm »
That message is printed out in the assumption that a null pointer is mainly caused by the situation mentioned in the message. I don't think that this applies here. Just check what the actual exception is (my code should log it afterwards, I don't know what your port does) or at least, in which line is happens. Still, there's something fishy with the way in which is setup things. There should be no need to catch some exceptions that happen during init. It doesn't really help, it just postpones the problem.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #139 on: August 03, 2021, 07:57:47 pm »
The NullPointerException only says, "Object reference not set to an instance of an object." Very useful, so I printed both the stack and the following messages:
Quote
NullReference:    at Object3D.render(Boolean software, Single mx, Single my, Single scalex, Single scaley, Single divx, Single divy, Boolean mayOptimize, Int32 tc, FrameBuffer buffer)
   at WorldProcessor.processInternal(FrameBuffer buffer, List`1 objectList, Portals portals, Camera camera, Boolean software, Single mx, Single my, Boolean mayOptimize, Boolean hasToSort, Int32 start, Int32 end, Single camScaleX, Single camScaleY, Boolean gl)
   at WorldProcessor.process(FrameBuffer buffer, List`1 objectList, Portals portals, Camera camera, Boolean software, Single mx, Single my, Boolean mayOptimize, Boolean hasToSort, Int32 start, Int32 end, Single camScaleX, Single camScaleY, Boolean gl)
   at World.renderScene(FrameBuffer buffer)
Object3D.render(): compiled. Is visList null? False
Object3D.render(): compiled. Is visList null? False
[ 8/4/2021 3:25:24 AM ] - WARNING: World.renderScene(): There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of BR3D objects on a thread different from the rendering thread! Is camera null? False Is visList? False
« Last Edit: August 04, 2021, 08:28:24 am by AGP »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #140 on: August 04, 2021, 03:45:00 pm »
No line number of any kind?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #141 on: August 04, 2021, 08:34:47 pm »
It's compiled code, man, it's not a bytecode. No line numbers in C# stack traces.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #142 on: August 05, 2021, 12:12:28 pm »
C# compiles into CIL, which is bytecode as well. It's very similar to what Java does, hence the similar performance characteristics. It should be possible for it to print out a line number. With this error message alone, it's almost impossible to find out, what is null here. Maybe you can configure the compiler to include line numbers? Some debug mode or similar?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #143 on: August 06, 2021, 08:00:07 am »
Actually, I knew that. I also now know that the -debug option is not supported on Windows (or at least not Windows x64) for whatever reason. And every solution to line-number printing I find fails (one of them always prints line 0, another doesn't even compile on Mono). Fun.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #144 on: August 07, 2021, 08:02:36 pm »
See, that's why people should talk to each other. I could have been stuck on this forever if you hadn't mentioned line numbers. By making the debug call "debug:embedded" I got the line numbers in. The problem had been that my Lights class was not initializing the distanceOverride array. Compiled objects are still not rendering, though, so off to find that issue (now aided by the line numbers).
« Last Edit: August 08, 2021, 08:08:56 am by AGP »

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #145 on: August 09, 2021, 07:59:10 pm »
Update: the line thing (running my game by calling mono before the .exe) sometimes crashes the application and still fails to give you numbers. Here's where I am: I can compile(true) my main character. The Skybox, too, but it becomes semi-transparent. Nearly everything else disappears when compiled. Maybe the Skybox transparency is a hint, but I don't think so because the disappearing objects also don't show up as wireframes. It's as if jpct is either translating them far out of view or otherwise clipping them.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #146 on: August 09, 2021, 09:44:40 pm »
Or the rendering itself is faulty. Hard to tell. You can get the returned center of the objects. If that lies within reasonable bounds, the object should be visible. I think there is also a method similar to wasVisibleInLastFrame() or something like this in Object3D that you can call to see if the object was, well, visible (geometry wise, it doesn't mean that it has been rendered).

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #147 on: August 10, 2021, 07:48:37 pm »
I put a WriteLine on the following block inside CompiledInstance.render() and for every model, including the ones that didn't render, I get "...about to render."

Code: [Select]
                     if (!wireFrame) {
                            if (vertexAlpha) {
                                   // Actually, this doesn't matter but anyway...
                                   cols[3] = 1;
                            }
                            System.Console.WriteLine("CompiledInstance.render(): "+obj.getName() +" about to render.");

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Cpct?
« Reply #148 on: August 12, 2021, 12:08:11 am »
I'm getting, I think, to a crucial place. I believe that it's one of the following three variables. If you have any insight about what might be wrong that around line 544 in CompiledInstance the rendering block never clears the if (!useDL || (listID == 0 && !buffersCreated)) test (and, thus, never renders most objects) I would appreciate it. The following is the state of most every object in this forest scene.

Code: [Select]
if (useDL || (listID != 0 && buffersCreated))
         System.Console.WriteLine("Not rendering "+obj.getName() +" because useDL: "+useDL +", listID: "+listID +", buffersCreated: "+buffersCreated);
Quote
Not rendering grassB628_jPCT438 because useDL: True, listID: 0, buffersCreated: True

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #149 on: August 13, 2021, 10:53:30 am »
That actually doesn't look wrong to me at first glance. Does any object has a listID other than 0? If not, it might help to check where it gets assigned.