Sonic and Sega Retro Message Board: SADX Lantern Engine - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 5 Pages +
  • 1
  • 2
  • 3
  • 4
  • 5
    Locked
    Locked Forum

SADX Lantern Engine Dreamcast lighting for SADX PC! (v1.3, 08/13/17)

#31 User is offline ezodagrom 

Posted 16 January 2017 - 08:53 PM

  • Posts: 86
  • Joined: 28-August 11
  • Gender:Male

View PostMorph, on 23 December 2016 - 04:27 AM, said:

This is by no means perfect. There can be some performance issues due to the way I had to implement the shader into SADX's code, so I'm very curious to know how it performs for you guys, and with what hardware.

Having a few framerate dips to 40~55 here and there in the first part of Red Mountain (Sonic) when using this mod together with the Dreamcast Conversion mod. Framerate stays at 60 with either one of the mods, the dips just happen if they're both enabled.
Using the Steam version with BetterSADX though (which pretty much turns the Steam version to the 2004 version I guess), so dunno if that could be a cause for the dips.

Framerate is mostly stable in other stages other than a rare dip in a few places. but none as frequent as Red Mountain.

Specs, AMD Phenom II X4 955 3.2GHz and Nvidia Geforce GTX 1060 6GB.
This post has been edited by ezodagrom: 16 January 2017 - 08:53 PM

#32 User is offline PkR 

Posted 16 January 2017 - 11:24 PM

  • Posts: 124
  • Joined: 04-August 12
  • Gender:Male
  • Project:SADX Dreamcast Conversion, The Emeralds' Awakening

View Postezodagrom, on 16 January 2017 - 08:53 PM, said:

View PostMorph, on 23 December 2016 - 04:27 AM, said:

This is by no means perfect. There can be some performance issues due to the way I had to implement the shader into SADX's code, so I'm very curious to know how it performs for you guys, and with what hardware.

Having a few framerate dips to 40~55 here and there in the first part of Red Mountain (Sonic) when using this mod together with the Dreamcast Conversion mod. Framerate stays at 60 with either one of the mods, the dips just happen if they're both enabled.
Using the Steam version with BetterSADX though (which pretty much turns the Steam version to the 2004 version I guess), so dunno if that could be a cause for the dips.

Framerate is mostly stable in other stages other than a rare dip in a few places. but none as frequent as Red Mountain.

Specs, AMD Phenom II X4 955 3.2GHz and Nvidia Geforce GTX 1060 6GB.

I think it's happening because of two things: 1) The palette lighting shader is very CPU-dependent, and 2) The DC mod for Red Mountain increases draw distance, and the PL mod has to process more level geometry as a result.
Unfortunately I can't reduce draw distance because it causes clipping artifacts like these. Alternatively I could change the way those mountains appear with reduced draw distance, but then it would cause pop-in. So I don't really know if there's a good solution for it. Maybe I'll look into dynamic draw distance at some point.
Also, you might be aware of this, but that CPU is seriously bottlenecking your GPU. I have no dips at 1080p while running the game on the integrated GPU with an Intel i5-4210M, which is a dualcore laptop CPU.
Have a look at processes in Task Manager when you're running the game, perhaps you have something resource-intensive running in the background. If sonic.exe has very high CPU usage, then it's probably the PL mod choking it.

#33 User is offline ezodagrom 

Posted 17 January 2017 - 04:59 AM

  • Posts: 86
  • Joined: 28-August 11
  • Gender:Male
Looks like it may be the CPU indeed. I was mostly just curious on what was causing the dips, they're not very game breaking since they only happen at specific locations, overall it's still more stable (and better looking) than the vanilla Steam version. xD

Emerald Coast (60fps) - http://i.imgur.com/RW3aRjL.jpg
Red Mountain (45fps) - http://i.imgur.com/nlTKieR.jpg
After moving the camera a bit (60fps) - http://i.imgur.com/lw0OG8Y.jpg

I know about my CPU being a bottleneck, a few months ago I got a chance to get a better GPU for relatively cheap, so I took it.
I want to upgrade my CPU and everything else other than my GPU sometime, just gotta wait until I have more money though. ^^;

#34 User is offline Irixion 

Posted 17 January 2017 - 10:57 AM

  • Posts: 1494
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
I run the game on my onboard Skylate 6700k and it's at a locked 60 100% of the time. Oh AMD.

#35 User is offline ezodagrom 

Posted 17 January 2017 - 11:29 AM

  • Posts: 86
  • Joined: 28-August 11
  • Gender:Male

View PostIrixion, on 17 January 2017 - 10:57 AM, said:

I run the game on my onboard Skylate 6700k and it's at a locked 60 100% of the time. Oh AMD.

Well, the AMD Phenom II CPUs are from the Intel Core 2 era, it's not just a case of it being an AMD CPU, but a case of it being an old CPU.

#36 User is offline Morph 

Posted 18 January 2017 - 03:56 PM

  • AKA SonicFreak94.
  • Posts: 726
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA1/2 hax
  • Wiki edits:11
The reason it's so CPU dependent is because it has to switch shaders multiple times per frame (and that includes toggling it on and off!), which is really inefficient. It's a Direct3D bottleneck. Ideally what needs to happen is: the mesh to be rendered needs to be put into a queue, and then at the end of a frame the queue should be sorted by the required shader, and then finally rendered. That would reduce the shader switch count from potentially hundreds per frame to a maximum of 3.

For reference, here's my specs and performance:

CPU: AMD FX-6300 @ 4.1GHz (overclocked to its turbo speed)
RAM: 8GB 1600MHz DDR3
GPU: AMD R7 265 2GB (overclocked core at 1050MHz)

I'm playing at 1080p, with 16x anisotropic filtering and 8xEQ adaptive antialiasing (which applies the antialiasing to the alpha channel of transparent textures).

Emerald Coast: http://i.imgur.com/YyRx6bq.jpg
Red Mountain: http://i.imgur.com/GN7G4mS.jpg
Red Mountain, other direction: http://i.imgur.com/Er3SrEv.jpg
Red Mountain, no antialiasing: http://i.imgur.com/YFijQ3F.jpg

I tested with different antialiasing settings because I've run some profiling, and my GPU driver is getting CPU limited there. As you can see though, on <= modern Intel Core i3 tier performance CPUs (as far as single-threaded performance is concerned), we're getting nearly the same performance despite mine being more modern, and this is all due to that bottleneck I mentioned. This, by the way, is after I optimized shader parameter committing to hell and back (at least, to the best of my ability, although it could still use some work). It used to be worse, which is scary. You'll also probably notice my CPU wasn't even hitting its maximum frequency, which it typically does in multithreaded applications. If I was able to multithread this thing in any conceivable way, I would, but there's just no way to squeeze that into this existing pipeline as far as I can see.

I really want to implement the draw queue, and in fact SADX has one built in for rudimentary alpha sorting (spoiler: they tried so hard to make that work and it still fails when it's needed). There are a lot of potential complications due to SADX's rendering pipeline though. I know from experience, having already attempted to implement my own alpha sort queue.

p.s thanks for the performance report; I'm still interested in performance on a wider variety of hardware if anyone is willing to post.

View PostIrixion, on 17 January 2017 - 10:57 AM, said:

I run the game on my onboard Skylate 6700k and it's at a locked 60 100% of the time. Oh AMD.


mfw comparing modern cpu to really old cpu :psyduck:
This post has been edited by Morph: 18 January 2017 - 03:57 PM

#37 User is offline Irixion 

Posted 20 January 2017 - 04:45 PM

  • Posts: 1494
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
To be fair Skylake is a year old, and it's not that much faster than Haswell. 10% isn't really anything to write home about.

#38 User is offline ezodagrom 

Posted 20 January 2017 - 07:18 PM

  • Posts: 86
  • Joined: 28-August 11
  • Gender:Male

View PostIrixion, on 20 January 2017 - 04:45 PM, said:

To be fair Skylake is a year old, and it's not that much faster than Haswell. 10% isn't really anything to write home about.

The Phenom II series is almost 8 years old though, it's Core 2 Quad Yorkfield tier (which is just as old).
Even the early Nehalem i7 were considerably better, so naturally the more recent CPUs like Haswell and Skylake are alot better in comparison.

(If the AMD's Ryzen CPUs underperform, then the "Oh AMD" comment will be appropriate).

#39 User is offline Irixion 

Posted 20 January 2017 - 09:10 PM

  • Posts: 1494
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
At one point I had a Phenom x4 9500. iirc SADX ran pretty okay.

#40 User is offline ezodagrom 

Posted 21 January 2017 - 09:42 PM

  • Posts: 86
  • Joined: 28-August 11
  • Gender:Male

View PostIrixion, on 20 January 2017 - 09:10 PM, said:

At one point I had a Phenom x4 9500. iirc SADX ran pretty okay.

This isn't even about just running the game though, it's about running it with the dreamcast conversion mod and dreamcast lighting mod together (which runs mostly fine other than a few sections with drops with such an old CPU).

#41 User is offline Twinbee MkII 

Posted 22 January 2017 - 08:29 PM

  • Uber Snuzzlemuffins
  • Posts: 21
  • Joined: 23-June 05
  • Gender:Not Telling
  • Location:Use your imagination

View Postultima espio, on 23 December 2016 - 10:50 AM, said:

This is definitely one of the best mods for this game, it makes such a big difference :)/>/> It crashes at the character select screen if you have the character select mod on though.


I'm also having this issue and hope there's a solution.

#42 User is offline MainMemory 

Posted 22 January 2017 - 09:59 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3901
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Whoops, I totally forgot, Morph fixed it like a month ago, you can get a new release of CharSel that should fix it.

#43 User is offline Twinbee MkII 

Posted 22 January 2017 - 10:53 PM

  • Uber Snuzzlemuffins
  • Posts: 21
  • Joined: 23-June 05
  • Gender:Not Telling
  • Location:Use your imagination
OMG Thank you! You're the best!

#44 User is offline Dude 

Posted 22 January 2017 - 11:56 PM

  • Posts: 3121
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Random VR/AR trash
  • Wiki edits:43
This is amazing. It really reinforces the notion that lighting is the foundation of graphics. I actually really like the DX assets, even moreso than the original dreamcast assets, when this lighting is used. Hopefully fixing that bottleneck isn't too challenging, but either way the mod as it stands makes it feel like a new game.

#45 User is offline E-122-Psi 

Posted 23 January 2017 - 01:40 PM

  • Posts: 1728
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
This is a great advancement, however it to me only opens up potential. Having a mod that emulates the Dreamcast's atmosphere is brilliant, but I'd be even more interested seeing Morph and co get creative with their own dynamic lighting, especially since DX can likely stretch effects much more on PC than Dreamcast.
This post has been edited by E-122-Psi: 23 January 2017 - 01:41 PM

  • 5 Pages +
  • 1
  • 2
  • 3
  • 4
  • 5
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users