Critical Ocean Hunter issue

Having technical difficulties with Supermodel? Last-minute wardrobe malfunction? Get help here.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Critical Ocean Hunter issue

Postby Bart » Fri Apr 14, 2017 10:07 am

The lighting vector is described in eye space coordinates, if I remember correctly. But I wonder if it's possible that there is an alternative mode where one of the transformation matrices is applied to it automatically by the Real3D?
User avatar
Bart
Site Admin
 
Posts: 1997
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Critical Ocean Hunter issue

Postby Ian » Sat Apr 15, 2017 3:10 am

It's possible I guess :)
I'm glad harry is looking into these. My previous specular attempts were totally derailed by these corner cases.
Ian
 
Posts: 1122
Joined: Tue Feb 23, 2016 9:23 am

Re: Critical Ocean Hunter issue

Postby HarryTuttle » Sat Apr 15, 2017 4:00 am

This lines in the devguide grabbed my attention (page 198, emphasis by me):
SetSunVector
Sets the position of the sun.

void SetSunVector ( float sun_x, float sun_y, float sun_z ) ;

Description

Sets the vector that points from the origin of the environment to the light source. The
vector need not be normalized
.

What do they mean, that sun vector can have single components > 1, or that the GPU will automatically normalize them?

To recap: we have clamped sun intensity, (maybe) auto-normalized sun vectors. Model have normals between -1, 1 (checked by dumping those values), however their normal matrix transforms those value to something that can be much less than 1 or much more.

I think the latter behavior can be a trick to modulate sunlight at model level, since sun parameters are set at viewport level and affects all the scene models in the same way.

The problem is that you'll still have much darker or much over brightened models, so with wrong shading. Currently in the official build the model normals are normalized in vertex shader so the effect is much mitigated, but there are corner cases (Ocean Hunter being the more evident) that shows that you should have dimmed sun shading in models.

The remaining mysterious polygon bits (EdgeTranslucency, Smoothing, TranslatorMap Offset) don't give any hints.
User avatar
HarryTuttle
 
Posts: 481
Joined: Thu Mar 09, 2017 8:57 am

Re: Critical Ocean Hunter issue

Postby HarryTuttle » Sat Apr 15, 2017 9:25 am

I'm trying to make some sense of this culling node:
Code: Select all
0x01:   xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Model scale (float)

and fetched that node value inside:
Code: Select all
void CNew3D::DescendCullingNode(UINT32 addr)

after dumping some value to console it seems that for the majority of time is set to 0 or 1, but is some case, like the death star in SWT, it grows to 512. That node caught my attention because I thought that might be involved in models' normals scaling and their interaction with sun light, but I still haven't figured out what is for.
User avatar
HarryTuttle
 
Posts: 481
Joined: Thu Mar 09, 2017 8:57 am

Re: Critical Ocean Hunter issue

Postby Ian » Sat Apr 15, 2017 10:54 am

I've honestly never even looked at the model scale, wasn't aware it was actually used
Ian
 
Posts: 1122
Joined: Tue Feb 23, 2016 9:23 am

Re: Critical Ocean Hunter issue

Postby HarryTuttle » Sat Apr 15, 2017 11:05 am

I looked at mame's <model3.cpp> video source, it's one of those first two nodes used only in step 1.5 and beyond.
User avatar
HarryTuttle
 
Posts: 481
Joined: Thu Mar 09, 2017 8:57 am

Re: Critical Ocean Hunter issue

Postby MakutaMaster962 » Sat Apr 15, 2017 11:14 am

I apologize in advance if it seems like I'm trying to hijack/derail this topic, but my original intention for posting this topic was to inform you guys of only one particular issue that makes Ocean Hunter un-finish-able in the New 3d Engine(the issue in Level 5, the North Sea), which still persists in the latest available Supermodel SVN revision. I'm actually attempting to get this topic back on track. Or has any progress been made at all?
MakutaMaster962
 
Posts: 14
Joined: Wed Mar 08, 2017 7:50 am

Re: Critical Ocean Hunter issue

Postby HarryTuttle » Sat Apr 15, 2017 11:17 am

Ok, sorry ;)
Ian, if you think is worth we could open a new topic under the Dark Room about general sun light issues.
User avatar
HarryTuttle
 
Posts: 481
Joined: Thu Mar 09, 2017 8:57 am

Re: Critical Ocean Hunter issue

Postby Ian » Sat Apr 15, 2017 11:37 am

Makuta I looked into the issue and found what it was. The bad matrix is caused by the fact we are drawing in the middle of updating the memory. So the memory is not complete when we are drawing a frame. Unfortunately it's quite a fundamental issue that effects other games. We will fix it when we can.
Ian
 
Posts: 1122
Joined: Tue Feb 23, 2016 9:23 am

Re: Critical Ocean Hunter issue

Postby HarryTuttle » Sat Apr 15, 2017 11:56 am

Ian, if you approve I'll post later a dirty hack/patch in "The Dark Room" until this issue it's fixed in the proper way. It's a workaround for the time being, I just "sanitize" the far / near data in the "CNew3D::CalcViewport" function. It works well for seemingly all the games affected by that problem.

If you want I'll describe it better in a proper post.
User avatar
HarryTuttle
 
Posts: 481
Joined: Thu Mar 09, 2017 8:57 am

PreviousNext

Return to The Fitting Room

Who is online

Users browsing this forum: No registered users and 4 guests