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       

[Code] Shading Tutorial & Fixes - Ripper
Page 3 of 3 Goto page Previous  1, 2, 3
DieHard Wolfers Forum Index -> Code Tutorials 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
Born4battle
DieHard SS
DieHard SS


Joined: 24 Mar 2006
Last Visit: 08 Aug 2017

Topics: 37
Posts: 388
Location: Cherry Chocolate Reign!!!
usa.gif

PostPosted: Tue Apr 08, 2008 1:27 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I wouldn't. Going by my uncode-worthy brain, it seems that the engine is shading G0,R0,B0, fully.

_________________
Thunderstorm "War is a conflict that does not determine who is right, but who is left." Thunderstorm
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Wed Apr 09, 2008 1:43 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

yea... but how do you turn it off with an #ifdef statement? (dont worry i will be patient Smile )

_________________
}{even or }{ellt?

look for helt3d
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 4:27 ago.

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

PostPosted: Wed Apr 09, 2008 6:58 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

thellt wrote:
yea... but how do you turn it off with an #ifdef statement?
Uh, you don't. For every part of the code that uses the shading, at the start of the shading code, you need to put:

::: CODE :::
#ifdef shading


and where the shading code ends, you put right below it:

::: CODE :::
#endif


To turn the shading code on afterwards, enter this line somewhere in WL_DEF.H:

::: CODE :::
#define shading


To disable shading, put "//" just to the left of the "#define" part.
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Thu Apr 10, 2008 6:01 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

great... i didnt back up a copy of my code and did not remember what to modifie the stuff back to.. Sad i will be away from the comunity for most days except for 2sday+ thursdays due to the darn proxy filter at my school... "eff" (<--think about how it sounds!) the proxy filter! so what do i modify?

_________________
}{even or }{ellt?

look for helt3d
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 4:27 ago.

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

PostPosted: Thu Apr 10, 2008 9:00 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'd print out a copy of the shading tutorial and use it as a guide for what you put in. Either that, or have two windows open, side-by-side - One with the shading tutorial code, and the other window where you change the code you're working on.
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 0:03 ago.

Topics: 38
Posts: 2468
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sun Apr 13, 2008 3:09 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Or add an ingame toggle.
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Thu Apr 24, 2008 5:47 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

yeaaaah...
Quote:
Uh, you don't. For every part of the code that uses the shading, at the start of the shading code, you need to put:
i used the ifdef for the version h file and tried to use something specific... i will update the post when i get a chance with my code... Sad i cant today b/c i am not at home with my code...

_________________
}{even or }{ellt?

look for helt3d
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Sat May 31, 2008 9:07 am
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

how do u make an ingame toggle?

_________________
}{even or }{ellt?

look for helt3d
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 0:03 ago.

Topics: 38
Posts: 2468
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sat May 31, 2008 7:22 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, you'd do it like Tricob said and section off the code, but use an "if (shading)...else" sort of thing around each section rather than an '#ifdef', with the non-shading code after the else. Then add an option in the menu that changes the boolean 'shading' value (which will need to go in WL_DEF.H and probably also in WL_MENU.C) between true or false. It has been done (see the Map of the Month Competitions, they use Tab-S), but it does require a little bit of fiddling around with various pieces of code. Remember to make a backup if you are going to try. Smile If you like, you could send me your code and I'd do it for you. *says quietly* I'm so soft. Very Happy
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Mon Jun 02, 2008 4:26 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

thanks i will try to upload soon! thank gosh for people as nice as you. Smile Very Happy

(to refrain from double post i will EDIT this message with the code)

code post:

(i hope this helps

//ripp
// Different shade tables (and shade intensitys)
switch (gamestate.episode*10+mapon)
{
#ifndef AJVER
case 0:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 1:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 2:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 3:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 4:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 5:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 6:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 7:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 8:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
case 9:GenerateShadeTable(32,0,0,&gamepal,LSHADE_FOG); break;
#endif
#ifdef AJVER
default:GenerateShadeTable(0,0,0,&gamepal,NULL); break;
#endif

)

_________________
}{even or }{ellt?

look for helt3d
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 0:03 ago.

Topics: 38
Posts: 2468
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Fri Jun 06, 2008 9:53 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Did you include Ripper's NoShading() function when you did the tutorial? BTW, what is AJVER for?
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Tue Jun 10, 2008 10:56 am
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

i am very busy right now. but that is ok. ajver (aj's version)= a "version" of the game that is 100% dosbox compatible since aj has vista... Sad (i hate vista... Twisted Evil ) ajver is a simple switch i tried to make to turn off the shading.

about aj: AJ has had a tramatic brain injury when he was 4. he barely survived but made incredible progress. he is a student who i helped through our last school year. he is good at running computers fortunately. Smile i dicided to give him a copy of my game (no copyright issues i assure you Smile ). there is my problem --> i want the shading feature turnoffable (is that a word? Neutral ) with a simple on off switch.

extra notes:

i might submit a picture of what i incountered. (btw it is helarious) Laughing


to edit:
will submit results on this post when i get a chance to test my code. hope to hear from you. i love it here in this forum! Smile Smile Smile

_________________
}{even or }{ellt?

look for helt3d
Tris
Guest



Last Visit:





PostPosted: Sun Jan 18, 2015 6:12 am
   Subject: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

For some reason the WL_SCALE.C bit is unclear to me. Could somebody please show me the scaling routine as it should be?
Thanks!
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 4:27 ago.

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

PostPosted: Sun Jan 18, 2015 12:13 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I see what you mean; the "lines in blue" statement is kind of confusing, as there's no lines of blue in the tutorial. Confused
Tris
Guest



Last Visit:





PostPosted: Mon Jan 19, 2015 1:26 am
   Subject: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes, when I try to remove the said routines, it keeps compiling with errors.
Any pointers?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 4:27 ago.

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

PostPosted: Mon Jan 19, 2015 12:37 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'll have to leave your question for others to answer. I've never actually put the Shading feature in the regular Wolf3D code. Sad
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 08 Aug 2018

Topics: 46
Posts: 2313
Location: USA
usa.gif

PostPosted: Mon Jan 19, 2015 11:34 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@Hessler86: What errors do you get?

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 29 Jul 2018

Topics: 55
Posts: 2136
Location: Canada
blank.gif

PostPosted: Sat Jan 24, 2015 5:10 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The original tutorial (with the correct colors) can be found here:

http://homepage.o2mail.de/mkroll/

Just click on "Tutorials" at the top, then on "Shading" (11.01.2004). I've gotten that one to work in DOS before.
Tris
Guest



Last Visit:





PostPosted: Wed Apr 29, 2015 12:51 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It's all working fine now, thanks! Has anyone ever found a way to prevent the shading from being calculated AFTER the Get Psyched! screen?
It'd be nice, cosmetically, if the shade tables loading is done by the EXE DURING the Get Psyched! screen - causing the red line to increase at a slower pace.
Any pointers?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 4:27 ago.

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

PostPosted: Wed Apr 29, 2015 4:31 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It seems you'd need to rewrite PreLoadUpdate in WL_INTER.C and PM_Preload in ID_PM.C. It would work when you first enter the level or do a non-Quickload of the level. But if you Quickload the game afterwards, the shading will be "wrong".

But if this is something you try, I'd just about guarantee you'll need to calculate at least two slots in the shading table for every pixel that the "Get Pysched!" line moves. It has 256 slots to cover in all, so if the code stops short by even one slot, it's all in vain.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 29 Jul 2018

Topics: 55
Posts: 2136
Location: Canada
blank.gif

PostPosted: Wed Apr 29, 2015 5:06 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I just used this: http://diehardwolfers.areyep.com/viewtopic.php?p=50979#50979
Here's an example of how it looks: https://www.youtube.com/watch?v=XB64ni2cLEs

Having it load at the same time as the Get Psyched screen might work though. I imagine that would involve moving the PlayLoop switch and entire GenerateShadeTable() code into the area just before the end of PM_Preload then adding "current++;" and "update(current,total);" into the end of it where I had the "if (count%8 == 0)" stuff originally, and also adding 256 to value in total. If 256 is less than xmstotal and maintotal you might want to use "256*somenumber" and "current = current + somenumber;" so the line is distributed more evenly. Just air coding here.
Tricob wrote:
But if you Quickload the game afterwards, the shading will be "wrong".

Ah yes, that dreaded QuickLoad... Thunderstorm
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 3 of 3 Goto page Previous  1, 2, 3
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Add Text to Screen at Skill Level select - Chris
Author: Chris
3 2880 Tue Sep 28, 2010 6:59 pm
Tricob View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 2729 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 2305 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 3095 Sun Oct 26, 2003 1:21 am
Guest View latest post
No new posts [Help] Different Enemy Dying Frames/Views
Author: Guest
7 609 Tue Jul 29, 2003 3:00 pm
Codetech84 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