Layered transparency

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
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: Layered transparency

Postby Ian » Tue Apr 11, 2017 12:48 pm

I didn't think it was using the headlight at all
and instead was maybe using a texture as a headlight with probably an additive blend
Ian
 
Posts: 836
Joined: Tue Feb 23, 2016 9:23 am

Re: Layered transparency

Postby Ian » Mon Apr 17, 2017 1:15 pm

Well about emergency call ambulance
I parsed out the info it needs to make this work.

This is the raw data for LOD4 from the first entry in the blend table. Each entry represents a separate viewport

Code: Select all
lod table 0.000100 10000.000000
lod table 0.000000 8.928573
lod table 0.000000 10.204089
lod table 0.000000 11.904763
lod table 0.000000 14.285728
lod table 0.000000 17.857145
lod table 0.000000 23.809492
lod table 0.000000 35.714291
lod table 0.000000 71.428886
lod table 0.000100 10000.000000
lod table 0.000100 10000.000000
lod table 0.000100 10000.000000


This is what the data looks like for a blend table entry for lods 0-3
Image

Quite strange the delete value where the model is supposed to fade out, ends before the previous LOD values.

The lodTablePointer in the culling node function is the index into the table. I think it's almost always 0, although technically there are up to 128 table entries.

That's as far as I got anyway.

The layered stencil/transparency stuff is still a mystery.
Ian
 
Posts: 836
Joined: Tue Feb 23, 2016 9:23 am

Re: Layered transparency

Postby Bart » Mon Apr 17, 2017 2:43 pm

So it's using the LOD system and one viewport per ambulance? Are the viewports in the same place? What's the second number in each entry? Angle or distance?

If I understand correctly, it's creating this effect by drawing the ambulance with slightly different distances or angles, with the LOD table set up appropriately so that the blending effect is visible?
User avatar
Bart
Site Admin
 
Posts: 1827
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Layered transparency

Postby Ian » Mon Apr 17, 2017 2:46 pm

I think it's drawing identical ambulance models,
But each one has a separate viewport with separate blend tables. The blend table values vary each viewport
It's a pretty horrible way of doing it, but it works I guess.
Ian
 
Posts: 836
Joined: Tue Feb 23, 2016 9:23 am

Re: Layered transparency

Postby Ian » Thu Apr 20, 2017 1:12 pm

Back to layered transparency
This one puzzles me a lot
Image

On the real hardware it looks like this

Image

The yellow lights in the background are viewport priority number 1, the glass on top is priority 3. For some reason the lights are being totally removed by the glass
Ian
 
Posts: 836
Joined: Tue Feb 23, 2016 9:23 am

Re: Layered transparency

Postby HarryTuttle » Sun Apr 23, 2017 5:55 am

I think this is the solution: "depth peeling", i.e. a method of order-independent transparency. Here's a simple way to implement it (scroll to the first answer).

And here is an Nvidia's white paper.

Incidentally this almost fixed the flickering shadows in games without using the hack that renders them as stencil polygons, also it correctly renders the smoke in Harley, and many other things in Sega Rally 2. This has nothing to do with the multiple semi-transparent ambulance clones in that famous sequence of ECA. That could be resolved implementing model LODs as Ian is doing.

This is my first attempt to that:
eca1.jpeg
eca1.jpeg (66.56 KiB) Viewed 96 times

It's just a proof of concept, I've hacked the "RenderFrame" and "RenderScene" functions to render, as usual, the opaque geometry in 4 passes (corresponding to the layer priorities). Then the transparent models, ignoring the 4 priority levels, in a 2-pass fashion, as described in the first link. This is *NOT* the correct method as it horribly breaks everything else. It's just a quick attempt to confirm that this might be a good starting point.
Last edited by HarryTuttle on Sun Apr 23, 2017 9:12 am, edited 1 time in total.
User avatar
HarryTuttle
 
Posts: 295
Joined: Thu Mar 09, 2017 8:57 am

Re: Layered transparency

Postby Ian » Sun Apr 23, 2017 8:13 am

Harry, you looked at the missing ocean hunter transparency? It doesn't seem to be doing anything with the blend tables. No idea where the transparency is coming from.. I can only guess somewhere in the culling nodes.
Ian
 
Posts: 836
Joined: Tue Feb 23, 2016 9:23 am

Re: Layered transparency

Postby HarryTuttle » Sun Apr 23, 2017 8:50 am

Ian wrote:Harry, you looked at the missing ocean hunter transparency? It doesn't seem to be doing anything with the blend tables. No idea where the transparency is coming from.. I can only guess somewhere in the culling nodes.


You're referring to the issue described here http://www.supermodel3.com/Forum/viewtopic.php?f=2&t=1381#p12534 ? 'Cause I haven't checked it yet. I was messing these days with the way transparent models are being rendered and assembled.

I'll look at it later anyway. :)
User avatar
HarryTuttle
 
Posts: 295
Joined: Thu Mar 09, 2017 8:57 am

Re: Layered transparency

Postby Ian » Sun Apr 23, 2017 8:53 am

That's the one :)
I checked the polys themselves have no transparency values in the poly headers. They are fully opaque.
Ian
 
Posts: 836
Joined: Tue Feb 23, 2016 9:23 am

Re: Layered transparency

Postby HarryTuttle » Sun Apr 23, 2017 9:11 am

Ian wrote:I can only guess somewhere in the culling nodes.


Just played that level, and I think too that could be a value in culling nodes. The monster's body is the issue, 'cause the tentacles are rendered fine, they also fade-in like the arcade.

I'll try the debug function with the old engine, I hope to find something useful.
User avatar
HarryTuttle
 
Posts: 295
Joined: Thu Mar 09, 2017 8:57 am

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest