DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

Changing the color of the rain
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 0:07 ago.

Topics: 73
Posts: 3765

blank.gif

PostPosted: Fri May 22, 2015 7:13 am
   Subject: Changing the color of the rain
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Looking through the DrawRain function, I was unable to find a way to alter the color of the rain. So I searched a bit on the forum:

BrotherTank wrote:
As for the color of the rain.. it's dependant on your palette.. and the positions of the white/grayscale in that palette. It's not hard coded to any specific colour, but rather chooses levels of grayscale based on the spacial position the rain is to be placed on the screen. ie: the closer the rain to the front of the screen, the lighter the colour will be... and that enhances the 3d effect of the rain...


So, it doesn't seem to be hard coded in anyway. How would one hard code the color of the rain, so that it, for instance, would be possible to rain lava (orange), blood (red) or toxic waste (green)?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 5:19 ago.

Topics: 163
Posts: 8194
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri May 22, 2015 4:12 pm
   Subject: Re: Changing the color of the rain
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Unless I'm mistaken, the code uses three separate colors to draw one raindrop, and it runs those colors through shaders on top of that. In WL_ATMOS.CPP, you'll find this in the DrawRain routine:
::: CODE :::
            vbuf[yy * vbufPitch + xx] = shade+15;
            vbuf[(yy - 1) * vbufPitch + xx] = shade+16;
            if(yy > 2)
                vbuf[(yy - 2) * vbufPitch + xx] = shade+17;
This is the three colors I was talking about.

A few lines above that, you'll find this:
::: CODE :::
        z = (az * viewcos - ax * viewsin) >> 8;
        if(z <= 0) continue;
        shade = z >> 17;
        if(shade > 13) continue;
This is where the code *appears* to calculate how far away the "rain drop" is from the player, and uses that distance to properly shade the three pixels mentioned above.
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 0:07 ago.

Topics: 73
Posts: 3765

blank.gif

PostPosted: Wed May 27, 2015 7:45 am
   Subject: Re: Changing the color of the rain
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Red Rain:

::: CODE :::
vbuf[yy * vbufPitch + xx] = shade+24;
            vbuf[(yy - 1) * vbufPitch + xx] = shade+25;
            if(yy > 2)
                vbuf[(yy - 2) * vbufPitch + xx] = shade+26;


Green rain:

::: CODE :::
vbuf[yy * vbufPitch + xx] = shade+90;
            vbuf[(yy - 1) * vbufPitch + xx] = shade+91;
            if(yy > 2)
                vbuf[(yy - 2) * vbufPitch + xx] = shade+92;


Light blue rain:

::: CODE :::
vbuf[yy * vbufPitch + xx] = shade+120;
            vbuf[(yy - 1) * vbufPitch + xx] = shade+121;
            if(yy > 2)
                vbuf[(yy - 2) * vbufPitch + xx] = shade+122;


Dark blue rain:

::: CODE :::
vbuf[yy * vbufPitch + xx] = shade+140;
            vbuf[(yy - 1) * vbufPitch + xx] = shade+141;
            if(yy > 2)
                vbuf[(yy - 2) * vbufPitch + xx] = shade+142;
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Sticky: [Tutorial] Compiling Wolf4SDL with Code::Blocks
Author: dcbasic
90 24559 Wed May 24, 2017 7:53 pm
Falcon*93 View latest post
No new posts [Help] Disabling "Full Screen" Mode
Author: WSJ
4 1380 Sat Aug 02, 2008 6:42 pm
Tricob View latest post
No new posts [CODE] Health Shown as a message with full screen view
Author: Raziel
13 2797 Thu Jul 31, 2008 8:07 pm
Raziel View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 3286 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3204 Sat May 17, 2008 11:26 am
Mortimer View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group