Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

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


3 posters

    [SDL tutorial] Transparent ceilings...

    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    [SDL tutorial] Transparent ceilings... Empty [SDL tutorial] Transparent ceilings...

    Post by WLHack Mon Nov 30, 2009 2:49 am

    Some of you have already seen this in DHW before but I decided to post it here aswell...
    In this tutorial I help you to create transparent ceilings (like in the Lair of Mantis - of coursre
    my routine might differ a lot from the one theJosh used)...

    Open wl_floorceiling.cpp and change the very end of the file from this:
    Code:

                  if (curbottex != lastbottex)

                        {

                            lastbottex = curbottex;

                            bottex = PM_GetTexture(curbottex);

                        }

                        u = (gu >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);

                        v = (gv >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);

                        unsigned texoffs = (u << TEXTURESHIFT) + (TEXTURESIZE - 1) - v;

    #ifdef USE_SHADING

                        if(curtoptex)

                            vbuf[top_add] = curshades[toptex[texoffs]];

                        if(curbottex)

                            vbuf[bot_add] = curshades[bottex[texoffs]];

    #else

                        if(curtoptex)

                            vbuf[top_add] = toptex[texoffs];

                        if(curbottex)

                            vbuf[bot_add] = bottex[texoffs];

    #endif

                    }

                }

                gu += du;

                gv += dv;

            }

        }

    }

    and replace it with this:

    Code:


                        if (curbottex != lastbottex)

                        {

                            lastbottex = curbottex;

                            bottex = PM_GetTexture(curbottex);

                        }

                        u = (gu >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);

                        v = (gv >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);

                        unsigned texoffs = (u << TEXTURESHIFT) + (TEXTURESIZE - 1) - v;
                    // Get tranparent:
                        byte color1=*(toptex+texoffs);
                        byte color2=*(bottex+texoffs);
                   

    #ifdef USE_SHADING

                        if(curtoptex){
                            if (color1 != 0xff)
                                vbuf[top_add] = curshades[toptex[texoffs]];

                        }

                        if(curbottex){
                          if (color2 != 0xff)
                              vbuf[bot_add] = curshades[bottex[texoffs]];

                        }
    #else
                        if(curtoptex)
                          if (color1 != 0xff)
                              vbuf[top_add] = toptex[texoffs];

                        if(curbottex)
                          if (color2 != 0xff)
                              vbuf[bot_add] = bottex[texoffs];

    #endif

                    }

                }

                gu += du;

                gv += dv;

            }

        }

    }

    #endif



    Last edited by WLHack on Tue Feb 26, 2013 1:31 am; edited 1 time in total



    Hammer: I can see it now: you and the moon - wear a necktie so I'll know you.
    Building a new webpage...
    Dark_wizzie
    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!


    Female
    Number of posts : 5120
    Age : 30
    Location : California, USA
    Job : Investor
    Hobbie : Computers, chess, computer chess, fashion, and philosophy
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    [SDL tutorial] Transparent ceilings... Empty Re: [SDL tutorial] Transparent ceilings...

    Post by Dark_wizzie Mon Nov 30, 2009 3:35 pm

    Hey, how about a screenshot of the new effects? Very Happy



    Wolf3d Haven
    Minute Logic Blog
    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    [SDL tutorial] Transparent ceilings... Empty Re: [SDL tutorial] Transparent ceilings...

    Post by WLHack Tue Dec 01, 2009 2:29 am

    I try to post one later this evening...



    Hammer: I can see it now: you and the moon - wear a necktie so I'll know you.
    Building a new webpage...
    avatar
    thejosh
    Black Cat
    Black Cat


    Number of posts : 13
    Age : 38
    Registration date : 2009-11-20

    [SDL tutorial] Transparent ceilings... Empty Re: [SDL tutorial] Transparent ceilings...

    Post by thejosh Sat Dec 05, 2009 6:32 pm

    WLHack wrote: transparent ceilings (like in the Lair of Mantis - of coursre
    my routine might differ a lot from the one theJosh used)...

    I used code by Alumiun for transparent ceilings in my mod, He posted a tutorial on it a while ago at dhw somewhere, if you can find it, that's what my routine looks like Very Happy
    avatar
    WLHack
    Senior Member
    Senior Member


    Male
    Number of posts : 800
    Age : 35
    Location : Finland
    Registration date : 2007-03-26

    [SDL tutorial] Transparent ceilings... Empty Re: [SDL tutorial] Transparent ceilings...

    Post by WLHack Sun Dec 06, 2009 5:54 am

    Ah, that one... I tried it out but it didn't seem to do anything (or I just implemented it wrong)...



    Hammer: I can see it now: you and the moon - wear a necktie so I'll know you.
    Building a new webpage...

    Sponsored content


    [SDL tutorial] Transparent ceilings... Empty Re: [SDL tutorial] Transparent ceilings...

    Post by Sponsored content


      Current date/time is Thu Nov 07, 2024 7:59 pm