Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


    Shading (fog) in Wolf4SDL

    Share

    mar
    Can I Play, Daddy?
    Can I Play, Daddy?

    Male
    Number of posts : 27
    Age : 37
    Location : Czech republic
    Job : Programmer
    Hobbie : Oldschool games
    Registration date : 2012-05-25

    Shading (fog) in Wolf4SDL

    Post by mar on Sun Jun 10, 2012 3:51 pm

    Hi guys, I've been hacking a bit with Wolf4SDL a bit (v1.7, is there a newer code base?).
    What bothers me is that in 256 color mode, you have to map colors to existing palette which
    makes shading look very ugly in some cases, which is a pity as I've seen it being used
    in lots of cool mods.
    So i decided to try to use 16 or 32-bit screenBuffer instead. There're still many problems,
    especially palette fades and so on. If time permits and if I find a solution I will upload
    the modified source somewhere. The rgb solution would allow to shade textures with animated
    palette (with some extra work of course) and i believe it would allow for new cool effects.
    Of course the drawback is extra memory and some performance penalty
    but Wolf4SDL is not intended for DOS anyway.

    original (8bpp, palette):

    32bpp, rgb:


    I chose a bad area (and JPEG did its job - not my fault, the images i uploaded were jpegs with quality 100)
    but you sure noticed for example colorful textures going gray etc.
    So what do you think? Please let me know if something like that has been attempted before.
    I don't have much free time for this so no need to reinvent the wheel (btw. has someone tried mipmapping yet?)

    Andy
    Seasoned Wolfer
    Seasoned Wolfer

    Number of posts : 280
    Registration date : 2007-12-22

    Re: Shading (fog) in Wolf4SDL

    Post by Andy on Mon Jun 11, 2012 4:00 am

    Very nice work, mar. I don't recall this ever being done before.

    Does it affect game performance at all?

    mar
    Can I Play, Daddy?
    Can I Play, Daddy?

    Male
    Number of posts : 27
    Age : 37
    Location : Czech republic
    Job : Programmer
    Hobbie : Oldschool games
    Registration date : 2012-05-25

    Re: Shading (fog) in Wolf4SDL

    Post by mar on Mon Jun 11, 2012 4:45 am

    Thanks Andy. Yes there will be some performance hit. I will quantify it as soon as I finish it.
    I already solved the palette problems, but have some minor things to fix yet.

    ronwolf1705
    Hardcore Wolfer
    Hardcore Wolfer

    Male
    Number of posts : 1252
    Age : 25
    Registration date : 2007-03-26

    Re: Shading (fog) in Wolf4SDL

    Post by ronwolf1705 on Mon Jun 11, 2012 6:59 am

    With this way of shading, could you also make a level insanely dark? It's an effect I've always wanted to use but it doesn't look great with the old way of creating shading.




    mar
    Can I Play, Daddy?
    Can I Play, Daddy?

    Male
    Number of posts : 27
    Age : 37
    Location : Czech republic
    Job : Programmer
    Hobbie : Oldschool games
    Registration date : 2012-05-25

    Re: Shading (fog) in Wolf4SDL

    Post by mar on Mon Jun 11, 2012 12:50 pm

    Yes it should be possible. There's still some minor issues like ugly frame after get psyched and shading
    bypasses fade to red when killed (no easy way to fix).
    I also added nonlinear shade define to version.h, as well as 32-bpp mode define.
    The source along with precompiled windows binaries can be found here:
    http://www.mediafire.com/download.php?x4cpevlomlo7x7i

    Runs smooth in 640x400 on core2 duo/2 GHz.
    However, 1280x800 is not smooth even with original Wolf4SDL but still even with smooth shades well playable.
    I haven't tested floors/atmos effect as I don't know how Smile

    Here's final screenshot with nonlinear, 32bpp shades:


    ronwolf1705
    Hardcore Wolfer
    Hardcore Wolfer

    Male
    Number of posts : 1252
    Age : 25
    Registration date : 2007-03-26

    Re: Shading (fog) in Wolf4SDL

    Post by ronwolf1705 on Mon Jun 11, 2012 2:46 pm

    You can make a good spooky mod with that kind of shading, looks great! Smile




    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!

    Male
    Number of posts : 5087
    Age : 22
    Location : USA or Tawain
    Job : Student, Part time Cactuar fanatic
    Hobbie : Planting Cactuars.
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    Re: Shading (fog) in Wolf4SDL

    Post by Dark_wizzie on Wed Nov 21, 2012 1:15 am

    Super late. Just discovered a thread in my own forum. Laughing
    Looks quite awesome. The shades of grey have been so standard in many mods, I got used to it. Hopefully newer mods won't have those bars of grey.



    Wolf3d Haven
    Minute Logic Blog

    tsalop
    Wolf3d n00b
    Wolf3d n00b

    Male
    Number of posts : 8
    Age : 27
    Location : Loppi
    Job : Junior Softwaredeveloper
    Registration date : 2013-02-14

    Re: Shading (fog) in Wolf4SDL

    Post by tsalop on Thu Feb 14, 2013 11:17 pm

    Looks great, I think I will be trying this out.

    Richter Belmont
    Bring em' On!
    Bring em' On!

    Male
    Number of posts : 231
    Age : 26
    Location : New Jersey, USA
    Job : Pushing Carts At Shop-rite
    Hobbie : Makeing Games, Playing Castlevania
    Message : Playing Lord of Shadows And I love it!!!
    Registration date : 2007-07-09

    Re: Shading (fog) in Wolf4SDL

    Post by Richter Belmont on Sat Oct 19, 2013 7:14 pm

    soo I did this thing

    Smooth Shading

    It works but I've found some kind of Bug...

    When the 32bit is off



    But with the 32bit on...This happens





    I'm Stumped for real...Someone give me a hand Please Sad

    Guest
    Guest

    Re: Shading (fog) in Wolf4SDL

    Post by Guest on Sun Oct 20, 2013 12:07 pm

    Hi Ted!


    Last edited by Chokster37 on Sat Feb 08, 2014 1:01 pm; edited 1 time in total

    Richter Belmont
    Bring em' On!
    Bring em' On!

    Male
    Number of posts : 231
    Age : 26
    Location : New Jersey, USA
    Job : Pushing Carts At Shop-rite
    Hobbie : Makeing Games, Playing Castlevania
    Message : Playing Lord of Shadows And I love it!!!
    Registration date : 2007-07-09

    Re: Shading (fog) in Wolf4SDL

    Post by Richter Belmont on Sun Oct 20, 2013 7:03 pm

    Chokster37 wrote:
    @Richter Belmont wrote:Someone give me a hand Please Sad
    Here you go

    Lawl.....But Anyways Its already been fixed in the Other Fourm tho But still Wondering about the Blue Ladder....

    Sponsored content

    Re: Shading (fog) in Wolf4SDL

    Post by Sponsored content Today at 6:30 pm


      Current date/time is Thu Sep 29, 2016 6:30 pm