Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
jmickle66666666

Writing a Doom style shader

Recommended Posts

I find this very interesting, this could be a milestone or the beginning of a new era in Doom history. Or may be i'm just imagining things? Well i had a dream many years ago..

I guess you're converting the levels using an automated process. If you manage to port or emulate the AI and all the stuff to make the levels playable (the DOOM source is GPL after all) you'd only need to run the iwads for this to qualify as a Doom engine. You'd need to convert them on the user's computer of course. And then you could have a classic mode emulating the old renderer and another one with modern lightning and stuff. Then people could create advanced real big 3D levels for Doom with better lightning and physics and without the performance limitations of the old inefficient engine.

Edited by drfrag

Share this post


Link to post

I'm not sure I like the idea. Unity isn't FLOSS software, and it would bite if someone made a mod exclusively for this.

Share this post


Link to post

My shader is written for Unity, but Unity uses standard CG and HLSL for their shaders, so my code is portable easily enough to any system. 

 

I'm also writing what I can in C# without ties to the Unity engine. Not all is possible (since a lot is implementation, not data reading), but what is portable is portable. All the code is on github here: https://github.com/jmickle66666666/DoomUnity

 

But overall: I'm making this as a hobby project, and I don't care if Unity is FLOSS or not. Every line of code I write for this will be open sourced, and Unity enables me to be doing what I'm doing. I'm not sure what the problem is if someone makes a mod for it.

Share this post


Link to post

That's very cool!  The end result does genuinely look like the vanilla software renderer.  Do you have any footage of it in action you'd be willing to share?

Share this post


Link to post

I made this video showing off the sounds and menu i was working on today: 

 

 

Doesn't show much of the level though. When I have a bit more done I'll make a proper thread for the engine

 

Share this post


Link to post

That’s pretty cool; I’ll keep your battle with the floors/ceilings in mind in case I ever decide to make something that will render Doom levels :)

 

Are you going to implement fake contrast too?

Share this post


Link to post

Fake contrast is already implemented, I just didn't cover it in the post because it's calculated outside the shader code. You can see it working on the pillars in the example shots.

Share this post


Link to post

That's amazing.  That "palette index as red value" trick is something I recognize and have used before, but seems like you took it the rest of the way.

 

Wonder if @Graf Zahl would implement something like this in GZDoom - if he hasn't already.

Share this post


Link to post
5 minutes ago, AlexMax said:

Wonder if @Graf Zahl would implement something like this in GZDoom - if he hasn't already.

Randi already did this for ZDoom (it uploads a single channel texture and uses a shader to assign the byte to each palette index on the GPU), GZDoom would already have it by extension (for the software renderer), and I'm unsure if it has it as an 8bit shader effect.

Fun fact, so did the original release of Keen Dreams on Steam. That was changed to a 32bit texture constructor when Icculus and I updated it, as SDL2 did a much better job of rendering it directly and the resolution was static 320x200 anyway, which is very cheap to produce. Any benefit from it nowadays would be from much larger resolutions.

Share this post


Link to post
2 hours ago, Edward850 said:

Randi already did this for ZDoom, GZDoom would already have it by extension (for the software renderer), and I'm unsure if it has it as an 8bit shader effect.

Unless I am misinterpreting what she's done, it looks like she's replicating the look of the software renderer in a truly 3D OpenGL renderer.  The novelty that jmickle appears to bring is doing 3D rendering using a palette, and then using the proper colormap index based on distance, which to my knowledge has not been done before.

 

If all you want is literally the software renderer on an OpenGL context, which is my understanding of what ZDoom used to do, the later steps she is taking are unnecessary (if it's even possible), you just do the red palette index trick from the normal software rendered output and you're done.

Edited by AlexMax

Share this post


Link to post

She* and yeah. My shader is entirely hardware meaning you can look up and down without y-shearing, and also mix and match it with anything else rendering too. It's just a material on a surface.

 

 

Screenshot 2017-12-26 03.07.27.png

Share this post


Link to post

I actually really want to see a game use this with fully modeled monsters and weapons, especially if it could emulate the higher-than-1px-resolution effect that comes with weapons on non-320x200 resolutions and enemies when they're close up. It wouldn't be super Doom-y that way, sure, but fluid animations and stuff like full rotations on map objects and view sway on weapons while still keeping the pixel-y look would be just 👌

 

edit: oh yeah how can i forget, stuff like dynamic lighting affecting things that look like sprites would be a really nice effect too

Share this post


Link to post
On 12/25/2017 at 9:09 PM, jmickle66666666 said:

She* and yeah. My shader is entirely hardware meaning you can look up and down without y-shearing, and also mix and match it with anything else rendering too. It's just a material on a surface.

 

 

Screenshot 2017-12-26 03.07.27.png

Alright, I want to see that skeleton in some real levels - that's badass!

Share this post


Link to post

For the contest of "who did this first", Randi's D3D9 2D acceleration indeed does use palette textures, but with a single colormap (no light levels). My "hard poly" renderer, which is a few months old, does the same as this unity shader when its in palette mode. Generally I agree with Edward850 that there's little extra involved in adding the light levels compared to what Randi did.

 

The shader isn't really the biggest problem in porting Doom to Unity, though. It is all the work required to get the sectors moving, supporting line actions, and implementing all the actors.

Share this post


Link to post

Slight tangent, but since folks are kinda talking about it, having original Doom-style shading (w/palette+colormap) in GZDoom's GL renderer is like the holy grail for The Adventures of Square. Quasi-relevant stuff here.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×