I experimented using the red gouraud palette sprite bug, which works fine as already known.
I also played with another technique that I just call the green gouraud bug, which shifts palettes 32 values, allowing you to interpolate the results.
While I'm not using gouraud on the level yet, I'm using flat lightning with palette shifts, so gouraud would just make it all smoother if I can make all the textures fit in 32 colors.
Here is the game with both the metal effect (working on real hardware nicely) using both green gouraud shifts (when the metal player is invincible) and red gouraud (both when invincible and not).
I (quickly) added global lightning to the maps using per-vertex lightning and averaging the results to get a per-quad flat lightning shifting palettes.
I also added back rings and ennemies, but the ennemies are static since I didn't code in an insertion function for the octree nodes.
Most impressive thing I've seen on the Saturn and I've been a Sega fan since 96 so cool. With the release of Sonic will there be a little FAQ on some of the engine features for Z-Tream and Saturn hardware. Its really interesting to see the Saturn do this sort of thing! Its as impressive as the Quake 2 port on the PSX but more so as a homebrew.
I'd originally been a little resistant to the idea of this as a possibly definitive treatment of Xtreme because of the switch from sprite-based to polygonal models for Sonic and the enemies, but now I prefer this change - especially if getting all that 2D animation into the Saturn's limited memory would have been too difficult for even Sega Technical Institute! Also, it's incredible to see that you managed to pull off a split screen mode, though I'm the most excited to finally explore those four levels only previously seen in video form (if only the other two from the same batch of footage could be somehow added). Here's to the future of your great project, and I can only apologise for initially denying the reasons behind your move to 3D for such a prominent detail...
Absolutely brilliant work XL2, without a doubt.
I have kind of an odd question, but what is your end goal for this project?
Obviously at this point Sonic Z-Treme goes well above and beyond any "tech demo" or "fan project" the Sega Saturn has ever seen, but do you want to take it to the extent of a full-featured game with a story-line, and linear level progression?
For all of the documentation regarding Sonic Xtreme's possible story, I'd prefer if any recreation simply concentrated on presenting disconnected levels. Similar to the Saturn version of Sonic 3D, it might be good to have short plot-advancing bookends, though I wouldn't spend too long worrying about how everything fits together from the perspective of offering cohesive narrative. Beyond each stage having the same number of acts and boss fights, did you need to know what was happening behind the scenes to get through the original 16-bit trilogy? Sure, every new sequel incorporated an increasing number of short cutscenes, but real character development was mostly left to the imagination of players or those who read the manuals. Z-Treme speaks through its graphics and overall authenticity compared to what fans expected on the Saturn back in late '96 - I certainly don't expect it to compete with Sonic Adventure in terms of building mythology or following canon.
The progress I see being made with this is truly stunning. A shame it can't be ported to the Dreamcast. Or can it?
For sure it would be much easier than on Saturn, but what would be the point doing it?
I mean, the whole point of this project is that it runs on Saturn.
The Dreamcast is so much more powerful, it wouldn't make sense to spend time porting such game and it wouldn't be fun for me anyway.
The point would be to have a nice looking homebrew Sonic game on Dreamcast. Sure it would take away from it being exclusive to Saturn but I think it would be fun to play on Dreamcast. Hell people play lots of 2D games on Dreamcast so I don't really see there not being a point to doing it other than preference.
Plus, if this project is open sourced you don't have to be the one to port it per se. I know a few homebrew developers in the Dreamcast community that could potentially give it a shot with your blessing of course.
Sorry for double post, but this is important!
Congrats on getting noticed by DigitalFoundry! Wow talk about epic exposure! I can't believe they are talking about it!
Not a real update on Sonic Z-Treme, but I managed to get real transparency using a technique similar to Burning Rangers working on real hardware.
Instead of swapping the frame buffers or waiting for it to complete its drawing in 2 passes like in BR, I do it all in one pass : I simply draw the transparent objects offscreen in the frame buffer's unused area (160x112) and scu direct DMA it to work ram. At vblank I send it to the vdp2 16 bpp nbg0 layer, zoomed at x: 2.2 and y:2.
It is pixallated, but sadly using the hardware blur function wouldn't work well I think since it disables the transparent pixels.
I simply use a loop and send/retrieve the data line by line to avoid having too much data passing and avoid having a huge buffer to hold the data.
The result is real transparency at little cost.
The game can still reach 60 fps, but less often than before.
In average it's now mostly 30 fps, but drops to 20 in several areas.
It's a cpu issue I guess, so some optimizations would solve the problem.
It's not glitching or anything, it seemed pretty consistent with what I had before.
Of course, sorting is still a very huge issue I will have to solve.
Here are shots from the game running on real hardware.
Also note that using the frame buffer in a sprite is also working, but since I'm using both RGB and palettes, only the RGB pixels get displayed.
Well done!
As far as I remember from my experiments from ages ago, this is precisely what Burning Rangers does, including a lower resolution draw for the transparent layer and the reuse of the same framebuffer for both the transparent layer and the background layer in a single frame, before swapping. The only difference may be the exact timing of the copies between the framebuffer and the VDP2 ram, and whether BR goes through work ram or elsewhere, which I don't actually recall right now.