Author Topic: Transparent Shading on The Saturn  (Read 822 times)

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #15 on: August 17, 2018, 05:32:52 am »
You mentioned the fm towns marty 3D sphere which gave me an idea but then I looked it up on youtube and it was nothing like my idea.

The idea is to use a normal VDP2 layer with small premade tiles and a CPU can decide how to composite the tiles to recreate what looks like any shadows.


The VDP1 draws arbitrary lines from the left line to the right using a greedy algorithm which causes pixels to be overdrawn. This avoids PS1-like gaps but causes the moire pattern with transparency. The other thing that causes the moire pattern was demonstrated well in one of Jon Burton's Sonic R videos. So unless each line is perfectly vertical or horizontal it'll overdraw causing transparency to be bollocks. This applies to skewed and rotated quads, not just perspective corrected quads.


One of the things you might have heard is that CRTs and composite video blurs the dithering enough to be a convincing shadow just drawing a dithered black oval over the ground. I didn't understand just how effective this was until I saw this composite capture of Z-treme on youtube: https://youtu.be/x7cW9wgIW00?t=50
Anyways you can tell how, back in the day, a team on a deadline scraping for ounces of power on a not quite adequate for 3D system would just draw an oval and be done with it.


I think one of the major issues with performance is that we're using an incredibly old jack-of-all-trades graphics library instead of tightly focused custom routines. Unlike a more straightforward graphics system, the saturn's really hard to write efficient graphic routines or even wrap your head around especially the memory scheduling. If two chips try to access the same memory chip in the same cycle, one of them will be halted until it gets access. This can basically throw away many cycles of work the saturn would otherwise be able to accomplish.

Anyways we got some interesting ideas floating around.

I can't blame anyone for being oblivious to this if you hadn't actually played on real Saturn hardware, but:

- The Saturn's AV / composite / yellow cable video signal is among the best (as far as that type is concerned).
- And yes, 100%, the typical transparency effect of blanking out half the pixels works pretty much flawlessly over this signal type. As far as I am concerned, the Saturn is meant to be used this way, and it would be nice if emulators included an image filter for it.
- S-Video, the near-neighbor display type to AV/yellow plug, is also good on the Saturn - in fact it's pretty much pixel perfect, which means the transparency effect is no longer convincing.
« Last Edit: August 17, 2018, 05:34:43 am by ponut64 »

20EnderDude20

  • Full Member
  • ***
  • Posts: 115
  • Karma: +6/-0
  • I'm also known as "The Blender Fiddler" on Youtube
    • View Profile
    • Youtube Channel
Re: Transparent Shading on The Saturn
« Reply #16 on: August 17, 2018, 05:56:21 am »
What's better, dithering, or over-transparency? In my opinion, I would choose something that is real vdp1 transparency, and not the same screen door method that's been used since the genesis. The designers never had the intention of the output being precise, but with s-video, I would rather stick to real transparency, simply because it gives the Saturn a chance of having transparency. Oh, yeah, and I think the n64 can only do 50% transparency because mario in sm64 uses dithering when using a secret warp, so we shouldn't get too ahead of ourselves.
« Last Edit: August 17, 2018, 05:59:49 am by 20EnderDude20 »

corvusd

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +8/-0
    • View Profile
    • Personal Web Portfolio
Re: Transparent Shading on The Saturn
« Reply #17 on: August 17, 2018, 09:46:03 am »
What's better, dithering, or over-transparency? In my opinion, I would choose something that is real vdp1 transparency, and not the same screen door method that's been used since the genesis. The designers never had the intention of the output being precise, but with s-video, I would rather stick to real transparency, simply because it gives the Saturn a chance of having transparency. Oh, yeah, and I think the n64 can only do 50% transparency because mario in sm64 uses dithering when using a secret warp, so we shouldn't get too ahead of ourselves.

N64 have REAL Alpha Blending. Is a patent of Silicon Graphics. PSX and SS not have Alpha blending, it is wired half-transparency. In its documentation says it clearly all this stuff. We not invent theories or data... already they lied enough in the past: History of millions of polygons on screen at 60 FPS. We stick to the technical data, clearly documented. Please.

Half-transparency is REAL and totally useful in SS. The key is archive the best way to use it without caveats: No Redraw, in 3D primitives and OK blend in all pipeline(VDP1+VDP2).

Example to start whit real approach: Burning Rangers.

In my Table analysis we have at 65 titles whit VDP1 CC half-transparent use. We can research all advantages and disadvantages in each case(geometry, layer, quantity, area pixels, type of color and pool VRAM, size texture, color calculation use it...), and get right conclusion about the objective. In the same way are other column to analysis of VDP2 semi-transparency... Feel free to make research and share! :)
« Last Edit: August 17, 2018, 01:57:08 pm by corvusd »
David Gámiz Jiménez

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #18 on: August 17, 2018, 11:00:35 am »
I agree with Corvusd.
It's easy to come up with ideas, but it seems nobody else ever actualy try to write the code themselves.
I've got ideas myself for more transparency (even if my game is filled with vdp2 transparency), but until it's written it's not worth much.
Like if you use vdp2 for sprite over sprite transparency, how do you solve the priorities?
It's super complicated, but most people don't think about these.
Like sure, I can use the NBG0 as a framebuffer, but then all my other sprites need to have the correct priority.
Even Burning Rangers struggled with it, and it was made by one of Sega's best studio.

20EnderDude20

  • Full Member
  • ***
  • Posts: 115
  • Karma: +6/-0
  • I'm also known as "The Blender Fiddler" on Youtube
    • View Profile
    • Youtube Channel
Re: Transparent Shading on The Saturn
« Reply #19 on: August 17, 2018, 03:55:02 pm »
But yet again, that 16-frame system might work. You just need the value of the angle of the camera, and you’re pretty much good to go.

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #20 on: August 18, 2018, 07:14:01 pm »
It's not about if you can find the proper angle. You would need that only for square objects, so probably only for the world objects or maybe some platforms. Each pixel takes 6 times the time it takes to draw a normal pixel. It doesn't make sense to have slowdowns for such a small details. And you increase cpu calculations as well. You could just use a msb  distorted sprite if you framebuffer is palette only, you could just precalculate that shadow and use palette swaps to create a shadow (which is what I do) or use another vdp1 color calculation function (like gouraud or half luminance). There are reasons why very few games used half transparency, and it's because of both the bug and the slowdown.
The mesh effect looked ok on crt with composite, which is what people used back then, so it just made sense to use that instead of decreasing your framerate.
Even Burning Rangers used the mesh effect very often.

jabfg

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #21 on: August 18, 2018, 10:57:39 pm »
The mesh effect looked ok on crt with composite, which is what people used back then, so it just made sense to use that instead of decreasing your framerate.
That depends on the region ;) , here in Europe we all used RGB since the scart cable came with the console.

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #22 on: August 19, 2018, 05:18:59 am »
The mesh effect looked ok on crt with composite, which is what people used back then, so it just made sense to use that instead of decreasing your framerate.
That depends on the region ;) , here in Europe we all used RGB since the scart cable came with the console.

I did not know that.
In which case, you've got pixel-perfect display...

20EnderDude20

  • Full Member
  • ***
  • Posts: 115
  • Karma: +6/-0
  • I'm also known as "The Blender Fiddler" on Youtube
    • View Profile
    • Youtube Channel
Re: Transparent Shading on The Saturn
« Reply #23 on: August 19, 2018, 05:30:21 am »
Is SCART basically RGB in another form factor?
« Last Edit: August 19, 2018, 05:33:55 am by 20EnderDude20 »

Jorhlok

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #24 on: August 19, 2018, 11:37:35 am »
Is SCART basically RGB in another form factor?

I'm an american so I might have something wrong but my understanding is that SCART is a multipurpose audiovisual cable/port specification. So it carries analog video and audio and supports what is equivalent to composite, s video, component, and RGB. Not everything that uses SCART does everything and if it does you need a cable that supports it by having those pins. This is sort of like an old VGA cable that's in my drawer that only has the bare minimum of pins and wires so things like the monitor sending specs via one of the pins won't work with that cable.
« Last Edit: August 19, 2018, 11:39:24 am by Jorhlok »

jabfg

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #25 on: August 19, 2018, 11:39:15 am »
SCART was a cable standard created in France that was adopted all over the Europe. It was created in the 70'S and supports bidirectional audio/video communication. It also supports RGB signal and the three types of sync( sync using the composite video, sync on Luma or pure SYNC).
All the TV in the 90's had this connector and the majority supported RGB signal ( expect the really cheap ones).
This standard was only dropped in favor of HDMI but the new TV's continue to bring the connector.
All Nintendo and Sega consoles supported the RGB through scart since the 16 bit era except (for unknown reasons) the Nintendo 64.
In the case of Sega Saturn the cable was bundled with the console and it supported RGB natively.
Japan also used a similar cable called JP21 that was physically the same but with switched signals. (See the attached diagram).
It also allows to play American /Japanese consoles in 60 hz. Because the majority of European TV s in the 90's supported 60hz in the form of PAL60 instead of NTSC (diferent type of video compression), if we use the composite cable or the almost not exitant s-video cable on these NTSC consoles the colors will be all messed up but with SCART in RGB mode, since there is no compression the image is displayed correctly.
The scart standard was only used on TV's, not on monitors except the old commodore 64/amiga ones (1084/1085 models).
I hope I helped.
« Last Edit: August 19, 2018, 12:18:33 pm by jabfg »

20EnderDude20

  • Full Member
  • ***
  • Posts: 115
  • Karma: +6/-0
  • I'm also known as "The Blender Fiddler" on Youtube
    • View Profile
    • Youtube Channel
Re: Transparent Shading on The Saturn
« Reply #26 on: August 19, 2018, 06:42:27 pm »
So, why doesn't the mesh effect create artifacts that the apple II and Atari 8 bit line used often for color (green and pink) in high-res mode?

Jorhlok

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #27 on: August 20, 2018, 02:21:41 am »
So, why doesn't the mesh effect create artifacts that the apple II and Atari 8 bit line used often for color (green and pink) in high-res mode?

Short answer: it did.

IIRC the original apple ii hardware is monochrome under the hood and was able to make color with composite monitors with patterns of white and black pixels. This is horizontally on a scanline.
I'm not as familiar with atari computers but high resolution modes for many computers such as 80 column mode on a commodore 128 is hardly legible on a composite monitor or tv. Thankfully you could use it with monochrome or the equivalent of s video monitors.

20EnderDude20

  • Full Member
  • ***
  • Posts: 115
  • Karma: +6/-0
  • I'm also known as "The Blender Fiddler" on Youtube
    • View Profile
    • Youtube Channel
Re: Transparent Shading on The Saturn
« Reply #28 on: August 20, 2018, 07:13:01 pm »
The Atari 8 bit line also offered the ability of the sprites to be used as an overlay to make real color in high res mode. Even transparency existed before the 16- bit generation ;).

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Transparent Shading on The Saturn
« Reply #29 on: August 22, 2018, 02:53:12 am »
I guess one "easy" solution to transparency involves the following trick :
-Calculate your 4 vertices. Sgl has a function to do it and return the results (something like slConvert3dto2dfx).
-Get your min x and max x.
-Build an array [max x - min x] containing your min y and max y (so 2 unsigned shorts).
-Doing a bit of interpolation, calculate your min y and max y for each x value.
-If you are feeling on fire, interpolate your gouraud shading too.
-Use MANUAL draw commands (slSetSprite in SGL) and use 2 points lines, with your current x value and min y for point A and your current x and max y for point B. Set your color, select transparency and in your draw priority put your z value (max or center usualy).

Now it won't work correctly with scaled sprites because your minimum width is 8 (but I never tried with zero, it might just work too even if Sega says it doesn't. If it does your points x width should be 1 ).
Your "covered" data in the framebuffer must be in rgb code (16 clut or rgb) else the transparency won't even be processed and you will waste precious cycles.
Like usual, expect slower performances with transparency, so make sure you have no overdraw if you use it.
Cpu wise it shouldn't be too demanding unless you do it for like 20 objects or more.


 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk