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 1 of 3 Goto page 1, 2, 3  Next
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
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Tue Feb 10, 2004 1:58 pm
   Subject: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Ripper's Shading Tutorial

Fasten your seat belts, it's getting a little rough this time:

As always you have to start with a working Wolfenstein 3D project and create a backup of your source!

Update: This is his latest routine. All changes inside the WL_GAME.C have been moved to the WL_PLAY.C to also allow demos to be shown and recorded correctly. Also the switch statement has been corrected for episode support! So if you previously installed this routine, prior to this post 03-16-2004, then you might want to update your code. RE: BrotherTank/MCS fix

On with the Tutorial.....

Open the "wl_def.h file and add the following definitions beneath the begining of the GLOBAL CONSTANTS section:

::: CODE :::

// Ripper's Shading Routine
#define SHADE_COUNT    32 // 32 Shades for each color
#define LSHADE_NORMAL 0
#define LSHADE_FOG 5


Open "wl_play.c and add this code at the begining of the "GLOBAL VARIABLES" section:

::: CODE :::
byte far shadetable[SHADE_COUNT][256];
int LSHADE_flag;


Now go to the PlayLoop function and add these two functions above it:

::: CODE :::
// Returns the palette index of the nearest matching color of the
// given RGB color in given palette
byte GetColor(byte red,byte green,byte blue,byte far *palette)
{
   byte mincol=0;
   double mindist=200000.F,curdist,DRed, DGreen, DBlue;
   int col;

   for(col=0;col<256;col++)
   {
      DRed   = (double) (red - *(palette+(col*3)));
      DGreen = (double) (green - *(palette+(col*3)+1));
      DBlue  = (double) (blue - *(palette+(col*3)+2));
      curdist=DRed * DRed + DGreen * DGreen + DBlue * DBlue;
      if(curdist<mindist)
      {
         mindist=curdist;
         mincol=(byte) col;
      }
   }
   return mincol;
}

// Fade all colors in 32 steps down to the destination-RGB
// (use gray for fogging, black for standard shading)
void GenerateShadeTable(byte red,byte green,byte blue,byte far *palette,int fog)
{
   int count;
   int n;
   double R,G,B,R1,G1,B1,DeltaR,DeltaG,DeltaB,StepR,StepG,StepB;

   // Set the fog-flag
   LSHADE_flag=fog;

   // Color loop
   for (count=0; count<256; count++)
   {
      // Get original palette color
      R=R1=(double) *(palette+(count*3));
      G=G1=(double) *(palette+(count*3)+1);
      B=B1=(double) *(palette+(count*3)+2);

      // Calculate difference to final color
      DeltaR=(double)red-R1;
      DeltaG=(double)green-G1;
      DeltaB=(double)blue-B1;

      // Calculate increment per step
      StepR=DeltaR / (double)(SHADE_COUNT+8);
      StepG=DeltaG / (double)(SHADE_COUNT+8);
      StepB=DeltaB / (double)(SHADE_COUNT+8);

      // Calc color for each shade of the active color
      for (n=0; n<SHADE_COUNT; n++)
      {
         shadetable[n][count]=GetColor((byte)R,(byte)G,(byte)B,palette);

         // Inc to next shade
         R+=StepR;
         G+=StepG;
         B+=StepB;
      }
   }
}


Look For:

::: CODE :::
void PlayLoop (void)
{
   int      give;
   int  helmetangle;


Then insert the following lines "into" the PlayLoop function below the lines above.
::: CODE :::
// Different shade tables (and shade intensitys)
   switch (gamestate.episode*10+mapon)
   {
      case 0:GenerateShadeTable(15,15,15,&gamepal,LSHADE_FOG); break;
      case 1:
      case 2:
      case 6:GenerateShadeTable(0,0,0,&gamepal,LSHADE_NORMAL); break;
      case 5:GenerateShadeTable(0,0,0,&gamepal,LSHADE_FOG); break;
      default:GenerateShadeTable(10,10,10,&gamepal,LSHADE_NORMAL); break;
   }


You can later change the shading attributes to fit your needs. Here you can set the color in RGB (red, green and blue (0-255)) to which the colors will change in the distance and another attribute which results in a foggy effect for values around 5 (LSHADE_FOG).

Our next target is the "wl_draw.c" file. Open it, and we'll add the wall shading support. Search for the words "GLOBAL VARIABLES" and add the following lines beneath the begining of the GLOBAL VARIABLES section:

::: CODE :::
extern byte far shadetable[SHADE_COUNT][256];
extern int LSHADE_flag;


Search for the "void ScalePost" function and replace the whole thing by the following line (don't touch the variables above (i.e. postwidth) or the FarScalePost function):

::: CODE :::
 extern void near ScalePost();


Basically what you want to do is comment out or delete the old ScalePost function completely, and replace it with the line above.

The last file we'll >change< is the WL_SCALE.C. Here we're going to add the sprite shading. Again you have to add the blue marked lines at the begining of the file beneath the begining of the GLOBALS section:

::: CODE :::
extern int LSHADE_flag;
byte shade=0;


Then search for the "ScaleLine" function. Now replace the whole ScaleLine function without toucing the variables defined above it (i.e. mask1) by this line:

::: CODE :::
extern void near ScaleLine();


In the ScaleShape function search for the following lines:

::: CODE :::
    scale = height>>3;               // low three bits are fractional
   if (!scale || scale>maxscale)
      return;                     // too close or far away


Add the following lines directly below the lines found above:

::: CODE :::
   switch(shapenum)
   {
      case 5:
      case 6:
      case 16:
      case 437:
         shade=0;   // let lamps "shine" in the dark
         break;
      default:
         shade=(scale<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
         if(shade>32) shade=32;
         shade=32-shade;
         break;
   }


Then search for SimpleScaleShape as you've got to make sure, that i.e. your pistol isn't shaded in some strange way sometimes.

Look for the lines:

::: CODE :::
   shape = PM_GetSpritePage (shapenum);

   scale = height>>1;


Add the following lines below the statements listed above:

::: CODE :::
   shade=0;


The last and most important step is to create a new file called "SHADE_A.ASM" and add it to your project. Create the file and save it as "shade_a.asm" with the following code in the file:

::: CODE :::
.model large
.486p

public _ScalePost,_ScaleLine

extrn _postsource:DWORD,_postx:WORD,_postwidth:WORD,_maxscaleshl2:WORD
extrn _wallheight:WORD,_fullscalefarcall,_shadetable
extrn _bufferofs:WORD,_mapmasks1,_mapmasks2,_mapmasks3
extrn _linescale:DWORD,_linecmds:DWORD,_slinex:WORD,_slinewidth:WORD
extrn _mask1:BYTE,_mask2:BYTE,_mask3:BYTE,_shade:BYTE
extrn _LSHADE_flag:WORD
extrn _viewheight:WORD

_DATA   segment word public use16 'DATA'
_DATA   ends
_BSS   segment word public use16 'BSS'
_BSS   ends

DGROUP   group   _DATA,_BSS

WL_DRAW_TEXT   segment byte public use16 'CODE'
   assume   cs:WL_DRAW_TEXT,ds:DGROUP

origstripe   db 64 dup (0)

_ScalePost   proc   near
   push   bp
   push   si
   push   di

   mov   bx,word ptr _postx
   mov   di,bx
   add   bx,bx
   mov   bp,word ptr [_wallheight+bx]
   and   bp,0fff8h
   shr   bp,1
   mov   bx,word ptr _maxscaleshl2
   cmp   bp,bx
   jle   heightok
   mov   bp,bx
heightok:

   shr   bx,8
   xor   dx,dx
   mov   ax,bp
   add   bx,word ptr _LSHADE_flag
   inc   bx
   div   bx                           

   or      al,al
   je      shadeclip
   cmp   al,31
   jbe   noshadeclip
   mov   al,31
   jmp   noshadeclip
shadeclip:
   mov   al,1
noshadeclip:
   neg   al
   add   al,32
   mov   bh,al

   push   ds
   push   fs
   mov   si,word ptr _postsource
   mov   ds,word ptr _postsource+2
   push   cs
   pop   es
   mov   di,offset cs:origstripe
   mov   ax,seg _shadetable
   mov   fs,ax
   mov   cl,64

shadeloop:
   mov   bl,[si]
   mov   al,byte ptr fs:[bx+offset _shadetable]
   inc   si
   mov   es:[di],al
   inc   di
   dec   cl
   jne   shadeloop
   pop   fs
   pop   ds


   mov   ax,0a000h
   mov   es,ax
   add   bp,offset _fullscalefarcall

   mov   bx,word ptr _postx
   mov   di,bx
   add   bx,bx
   shr   di,2
   add   di,word ptr _bufferofs
   and   bx,6
   shl   bx,2
   add   bx,word ptr _postwidth
   mov   al,byte ptr [_mapmasks1-1+bx]
   mov   dx,03c4h+1
   out   dx,al

   push   ds
   push   cs
   pop   ds
   mov   si,offset cs:origstripe

   call   dword ptr [bp]

   mov   al,byte ptr ss:[_mapmasks2-1+bx]
   or      al,al
   je      nomore

   inc   di
   out   dx,al
   call   dword ptr [bp]

   mov   al,byte ptr ss:[_mapmasks3-1+bx]
   or      al,al
   je      nomore

   inc   di
   out   dx,al
   call   dword ptr [bp]

nomore:

   pop   ds
   pop   di
   pop   si
   pop   bp
   ret
_ScalePost   endp

WL_DRAW_TEXT   ends


WL_SCALE_TEXT   segment byte public use16 'CODE'
   assume   cs:WL_SCALE_TEXT,ds:DGROUP

   ;
   ;   void near ScaleLine (void)
   ;

shadedcol   db   64 dup (0)

_ScaleLine   proc   near
   push   bp
   mov   bp,sp
   push   si
   push   di
   mov   al,byte ptr [_shade]
   mov   byte ptr cs:shadeval1,al
   mov   byte ptr cs:shadeval2,al
   mov   byte ptr cs:shadeval3,al
   mov   ax,seg _shadetable
   mov   fs,ax
   mov   cx,WORD PTR [_linescale+2]
   mov   es,cx                                  ; segment of scaler
   mov   bp,WORD PTR [_linecmds]
   mov   dx,03C4H+1                             ; SC_INDEX+1 to set SC_MAPMASK
   mov   bx,[_slinex]
   mov   di,bx
   shr   di,2                                   ; X in bytes
   add   di,[_bufferofs]
   and   bx,3
   shl   bx,3
   add   bx,[_slinewidth]                       ; bx = &mapmask3[slinex][slinewidth]-mapmask3
   mov   al,byte ptr [_mapmasks3-1+bx]       ; -1 because pixwidth of 1 is first
   mov   ds,word ptr [_linecmds+2]
   or      al,al
   je      short notthreebyte                     ; scale across three bytes
   jmp   threebyte
notthreebyte:
   mov   al,byte ptr ss:[_mapmasks2-1+bx]    ; -1 because pixwidth of 1 is first
   or      al,al
   jne   short twobyte                          ; scale across two bytes
   ;
   ;  one byte scaling
   ;
   mov   al,byte ptr ss:[_mapmasks1-1+bx]    ; -1 because pixwidth of 1 is first
   out   dx,al                                  ; set map mask register

scalesingle:
   mov   bx,[ds:bp]                             ; table location of rtl to patch
   or      bx,bx
   je      short linedone                         ; 0 signals end of segment list
   mov   bx,[es:bx]
   mov   dl,[es:bx]                             ; save old value
   mov   byte ptr es:[bx],0cbh                  ; patch a RETF in
   mov   si,[ds:bp+4]                           ; table location of entry spot
   mov   ax,[es:si]
   mov   word ptr ss:[_linescale],ax            ; call here to start scaling
   mov   si,[ds:bp+2]                  ; corrected top of shape for this segment
   add   bp,6                                   ; next segment list

   push   ds
   push   bx
   push   cs
   pop   es
   push   di
   mov   di,offset cs:shadedcol
   mov   ah,64
   mov   bh,12
shadeval1   equ $-1

spshadeloop1:
   mov   bl,[si]
   mov   al,byte ptr fs:[bx+offset _shadetable]
   inc   si
   mov   es:[di],al
   inc   di
   dec   ah
   jne   spshadeloop1
   pop   di
   pop   bx
   push   cs
   pop   ds
   mov   si,offset cs:shadedcol                   ; ds:si -> shadecol

   mov   ax,0a000h
   mov   es,ax
   call   ss:[_linescale]                        ; scale the segment of pixels
   pop   ds
   mov   es,cx                                  ; segment of scaler
   mov   byte ptr es:[bx],dl                    ; unpatch the RETF
   jmp   short scalesingle                      ; do the next segment

   ;
   ;  done
   ;
linedone:
   mov   ax,ss
   mov   ds,ax
   pop   di
   pop   si
   pop   bp
   ret

   ;
   ;  two byte scaling
   ;
twobyte:
   mov   ss:[DGROUP:_mask2],al
   mov   al,byte ptr ss:[_mapmasks1-1+bx]    ; -1 because pixwidth of 1 is first
   mov   ss:[DGROUP:_mask1],al

scaledouble:
   mov   bx,[ds:bp]                             ; table location of rtl to patch
   or      bx,bx
   je      short linedone                         ; 0 signals end of segment list
   mov   bx,[es:bx]
   mov   cl,[es:bx]                             ; save old value
   mov   byte ptr es:[bx],0cbh                  ; patch a RETF in
   mov   si,[ds:bp+4]                           ; table location of entry spot
   mov   ax,[es:si]
   mov   word ptr ss:[_linescale],ax            ; call here to start scaling
   mov   si,[ds:bp+2]                  ; corrected top of shape for this segment
   add   bp,6                                   ; next segment list

   push   ds
   push   bx
   push   cs
   pop   es
   push   di
   mov   di,offset cs:shadedcol
   mov   ah,64
   mov   bh,12
shadeval2   equ $-1

spshadeloop2:
   mov   bl,[si]
   mov   al,byte ptr fs:[bx+offset _shadetable]
   inc   si
   mov   es:[di],al
   inc   di
   dec   ah
   jne   spshadeloop2
   pop   di
   pop   bx
   push   cs
   pop   ds
   mov   si,offset cs:shadedcol                   ; ds:si -> shadecol

   mov   ax,0a000h
   mov   es,ax
   mov   al,ss:[DGROUP:_mask1]
   out   dx,al                                  ; set map mask register
   call   ss:[_linescale]                        ; scale the segment of pixels
   inc   di
   mov   al,ss:[DGROUP:_mask2]
   out   dx,al                                  ; set map mask register
   call   ss:[_linescale]                        ; scale the segment of pixels
   dec   di
   pop   ds
   mov   es,word ptr ss:[_linescale+2]          ; segment of scaler
   mov   byte ptr es:[bx],cl                    ; unpatch the RETF
   jmp   scaledouble                            ; do the next segment

   ;
   ;  done
   ;
linedone2:
   mov   ax,ss
   mov   ds,ax
   pop   di
   pop   si
   pop   bp
   ret

   ;
   ;   three byte scaling
   ;
threebyte:
   mov   ss:[DGROUP:_mask3],al
   mov   al,byte ptr ss:[_mapmasks2-1+bx]    ; -1 because pixwidth of 1 is first
   mov   ss:[DGROUP:_mask2],al
   mov   al,byte ptr ss:[_mapmasks1-1+bx]    ; -1 because pixwidth of 1 is first
   mov   ss:[DGROUP:_mask1],al

scaletriple:
   mov   bx,ds:[bp]                             ; table location of rtl to patch
   or      bx,bx
   je      short linedone2                        ; 0 signals end of segment list
   mov   bx,es:[bx]
   mov   cl,es:[bx]                             ; save old value
   mov   byte ptr es:[bx],0cbh                  ; patch a RETF in
   mov   si,ds:[bp+4]                           ; table location of entry spot
   mov   ax,es:[si]
   mov   word ptr ss:[_linescale],ax            ; call here to start scaling
   mov   si,ds:[bp+2]                  ; corrected top of shape for this segment
   add   bp,6                                   ; next segment list

   push   ds
   push   bx
   push   cs
   pop   es
   push   di
   mov   di,offset cs:shadedcol
   mov   ah,64
   mov   bh,12
shadeval3   equ $-1

spshadeloop3:
   mov   bl,[si]
   mov   al,byte ptr fs:[bx+offset _shadetable]
   inc   si
   mov   es:[di],al
   inc   di
   dec   ah
   jne   spshadeloop3
   pop   di
   pop   bx
   push   cs
   pop   ds
   mov   si,offset cs:shadedcol                   ; ds:si -> shadecol

   mov   ax,0a000h
   mov   es,ax
   mov   al,ss:[DGROUP:_mask1]
   out   dx,al                                  ; set map mask register
   call   ss:[_linescale]                        ; scale the segment of pixels
   inc   di
   mov   al,ss:[DGROUP:_mask2]
   out   dx,al                                  ; set map mask register
   call   ss:[_linescale]                        ; scale the segment of pixels
   inc   di
   mov   al,ss:[DGROUP:_mask3]
   out   dx,al                                  ; set map mask register
   call   ss:[_linescale]                        ; scale the segment of pixels
   dec   di
   dec   di
   pop   ds
   mov   es,word ptr ss:[_linescale+2]          ; segment of scaler
   mov   byte ptr es:[bx],cl                     ; unpatch the RETF
   jmp   scaletriple                            ; do the next segment

_ScaleLine   endp

WL_SCALE_TEXT   ends

end



Now go to the bottom of the BC3.1 Screen and click on your project files window. Press the <INSERT> key to add it, using the name "shade_a.asm". This file contains the mysteriously changed ScalePost and ScaleLine functions which now support shading Wink I guess it would have been a little bit TOO rough, if you had to type the whole 388 lines big file by yourself (yes, there really are people still not knowing the copy&paste features of Windoofy ;D).

Doing all of that.... You should now have Shaded Walls.... You should be able to compile and run it (providing you've done everything correctly so far).

Now:If you want to have a shaded solid colored floor and ceiling, you'll have to do a little more modifying. Replace the VGAClearScreen function in the "wl_draw.c" file, with the following version:

Update: The following function is now compatible with the "Outside Atmosphere" tutorial!

::: CODE :::
void VGAClearScreen (void)
{
   unsigned ceiling=vgaCeiling[gamestate.episode*10+mapon];
   word pitch=80;
#ifdef MAXSTARS
   int lmapon=gamestate.episode*10+mapon;
   if(lmapon>=LEVELSTATES) lmapon=LEVELSTATES-1;
   if(!levelSkyState[lmapon])
   {
#endif

      //
      // clear the screen
      //
      asm{
         mov dx,SC_INDEX
         mov ax,SC_MAPMASK+15*256
         out dx,ax

         mov ax,[viewwidth]
         shr ax,2
         sub word ptr pitch,ax

         mov dx,[viewwidth]
         shr dx,3
         mov dh,BYTE PTR [viewheight]
         shr dh,1

         mov es,[screenseg]
         mov di,[bufferofs]

         xor ah,ah
         mov al,byte ptr [ceiling]
         push ds
         mov si,seg shadetable
         mov ds,si
         mov si,offset shadetable
         add si,ax

         mov al,byte ptr [si]
         mov ah,al

         mov bh,dh
         shr bh,5
         inc bh
         mov bl,bh

         xor ch,ch
         push dx
      }
toploop:
      asm{
         mov cl,dl
         rep stosw
         add di,word ptr pitch

         dec bl
         jz nexttshade

         dec dh
         jnz toploop
         jmp topfin
      }
nexttshade:
      asm{
         add si,256
         mov al,byte ptr [si]
         mov ah,al
         mov bl,bh
         dec dh
         jnz toploop
      }
topfin:
      asm{
         pop dx
         mov si,offset shadetable+(SHADE_COUNT-1)*256
         add si,0x19         // floor color
         mov al,byte ptr [si]
         mov ah,al
         mov bl,bh
      }
bottomloop:
      asm{
         mov cl,dl
         rep stosw
         add di,word ptr pitch

         dec bl
         jz nextbshade

         dec dh
         jnz bottomloop
         jmp botfin
      }
nextbshade:
      asm{
         sub si,256
         mov al,byte ptr [si]
         mov ah,al
         mov bl,bh
         dec dh
         jnz bottomloop
      }
botfin:
      asm{
         pop ds
      }
#ifdef MAXSTARS
   }
   else
   {
      long siny,cosy;

      siny=(long)sintable[player->angle];
      cosy=(long)costable[player->angle];

      if(siny<0) siny=-(siny&0x7fffffff);
      if(cosy<0) cosy=-(cosy&0x7fffffff);

      PaintStars(siny,cosy);

      //
      // clear rest of the screen
      //
      asm{
         mov dx,SC_INDEX
         mov ax,SC_MAPMASK+15*256         // write through all planes
         out dx,ax

         mov es,[screenseg]
         mov di,[bufferofs]

         mov dx,80
         mov ax,[viewwidth]
         mov bx,ax
         shr ax,2
         sub dx,ax

         shr bx,3

         mov al,byte ptr [viewheight]
         mov bh,al
         shl ax,3
         add di,ax
         shl ax,2
         add di,ax

         shr bh,1

         mov ax,0x1919
         xor ch,ch
      }

bottomloop2:
      asm{
         mov cl,bl
         rep stosw
         add di,dx
         dec bh
         jnz bottomloop2
      }
   }
#endif
}


If you use DarkOne's Textured Floor/Ceiling feature, you'll have to make some additional changes to your code. Open up the WL_DRAW.C file and search for:

::: CODE :::
void VGAClearScreen (void)
{
   unsigned ceiling=vgaCeiling[gamestate.episode*10+mapon];


Change the first three lines of the above to make it compatible with DarkOne's tutorial again with the following:

::: CODE :::
void VGAClearScreen (unsigned ceiling)
{
// unsigned ceiling=vgaCeiling[gamestate.episode*10+mapon];


Then to make the floor and ceiling textures shaded, too, you've got to find the DrawFlats function and make the following changes. Within the "Drawflats" routine Search for:

::: CODE :::
void DrawFlats(unsigned tex_f, unsigned tex_c)
{
  int x, y, y0, halfheight;


Now change the "int x, y, y0, halfheight;" so it reads:

::: CODE :::
int x, y, y0, halfheight, shade;


Search for:

::: CODE :::
      gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
      du<<=2; // 4pix step
      dv<<=2;


And add Directly below the above lines:

::: CODE :::
      shade=(y<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
      if(shade>32) shade=32;
      shade=32-shade;


Then replace the following line:
::: CODE :::
color=src_top+((63-u)<<6)+(63-v));

With this line:
::: CODE :::
color=shadetable[shade][*(src_top+((63-u)<<6)+(63-v))];


Then replace this line:

::: CODE :::
color=(src_bot+(u<<6)+(63-v));

With this line:
::: CODE :::
color=shadetable[shade][*(src_bot+(u<<6)+(63-v))];


If you used the Directional 3D Sprites tutorial, you'll also need a small modification there. Open up the "wl_scale.c" file and search for the Scale3DShaper function and these lines:

::: CODE :::
         scale1=height>>11;

         if(wallheight[slinex]<(height>>8) && scale1 && scale1<=maxscale)
         {


Add these lines directly below the above found code:
::: CODE :::
            shade=(scale1<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
            if(shade>32) shade=32;
            shade=32-shade;


That's all you need to make the player wish, he had a flash light >D

Thanks for reading, give us some credits and have fun with dark and foggy scenes ;D

Ripper


Last edited by BrotherTank on Thu Mar 18, 2004 12:11 pm; edited 7 times in total
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 13 Aug 2016

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Thu Feb 12, 2004 12:52 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

When I added shading, everything was good, but when I used it on the level with the Sky effects (rippers), the moon and stars... The sky is now 3 different colors of green with no rain moon stars etc...

Is this my code only or is anyone else getting this, also does anyone know a fix for this?

_________________
~ James
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Thu Feb 12, 2004 1:03 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:
When I added shading, everything was good, but when I used it on the level with the Sky effects (rippers), the moon and stars... The sky is now 3 different colors of green with no rain moon stars etc...

Is this my code only or is anyone else getting this, also does anyone know a fix for this?


Yes... I'm reworking the "Fun with Textures" thread to include the shading. I've got a lot going right now, but I will post the new tutorial shortly...

Greg
BrotherTank
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Thu Feb 12, 2004 4:00 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:
When I added shading, everything was good, but when I used it on the level with the Sky effects (rippers), the moon and stars... The sky is now 3 different colors of green with no rain moon stars etc...

Is this my code only or is anyone else getting this, also does anyone know a fix for this?

Oh, those tutorials aren't compatible right now... Again I missed that *doh*
I'll fix that this weekend Mr Green
But if you have a look at the differences you should see, why you don't get what you wanted...

--------------------------
Edited by BrotherTank:

NOTE: The Tutorial Above has been modified to correct this problem
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Thu Feb 12, 2004 4:23 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ripper wrote:
jamez wrote:
When I added shading, everything was good, but when I used it on the level with the Sky effects (rippers), the moon and stars... The sky is now 3 different colors of green with no rain moon stars etc...

Is this my code only or is anyone else getting this, also does anyone know a fix for this?

Oh, those tutorials aren't compatible right now... Again I missed that *doh*
I'll fix that this weekend Mr Green
But if you have a look at the differences you should see, why you don't get what you wanted...


Actually.. mine works fine... but I spotted the differences in the VGAClearScreen routines (as did MCS) and all we did was something like:

::: CODE :::

void VGAClearScreen
{
    if (SkyLevelStates)
      {
           // Old Vga Clear Screen routine goes here
      }
    else
      {
          // New Vga Clear Screen goes here
       }
}


Although that's a simplified version of what we really did... it works nontheless..

Greg
BrotherTank
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Fri Feb 13, 2004 3:39 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yepp, that's the only "problem", but with just using copy&paste and not trying to understand ANYTHING the tutorial does, it results in a simple shaded ceiling. But for completelyness it should be added to the tutorial Wink
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 13 Aug 2016

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Fri Feb 13, 2004 2:38 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks buddy...

All your coding is way too advance for me, that's why i only use copy pasteing!

_________________
~ James
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Sat Feb 14, 2004 7:36 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I updated the tutorial yesterday, so now it works with demos and also different episodes are supported now (forgot it again, just like in the atmosphere tutorial Mr Green)
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 13 Aug 2016

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Mon Feb 16, 2004 11:06 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks for that... It works fine now..

I did find something wiered in my code thou...

Well it's in the game. I look at screenshots of people who have used snow/rain and the sky with darkones floor tutorial and they have snow falling in all places. In PVII it only falls in the ceiling...

It's not much of a problem, but I'd rather it was in the foreground too, can anyone help me here?

_________________
~ James
Kuki
Can I Play Daddy
Can I Play Daddy


Joined: 16 Mar 2003
Last Visit: 18 Jan 2010

Topics: 6
Posts: 43
Location: Torun/Olsztyn, Poland
poland.gif

PostPosted: Wed Feb 18, 2004 2:24 pm
   Subject: Shading tutorial bug report & fix
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Dunno if this was reported before... I think I've found a bug in the shading tutorial located in this (and similiar) parts of the code:

::: CODE :::
shade=(yd<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);  // shade is more than 255 and becomes 0
 if(shade>32) shade=32;
 shade=32-shade;               // shade becomes 32
 curshades=shadetable[shade];         // shadetable[32] is not in the array


>>Sorry for bad language here, but I don't know the names of different things in the code in English, hope you'll understand me<<

The problem appears when LSHADE_flag is a big number (GenerateShadeTable was called with large value 'fog') or with smaller LSHADE_flag but at great ranges. All shaded objects at some range have strange colors. I believe this happens cause the 'shade' variable becomes 0 and thus after 'shade=32-shade' shade becomes 32. shadetable[32] exceeds the array's size (normally it's 32 - from 0 to 31) and we get some random data from the memory. How can 'shade' become 0? Doesn't the '+1' prevent it from this? Well, no. I understand that when 'shade', which is byte, exceeds it's maximum value (255) it becomes 0.

Here's a fix (add the marked line):

::: CODE :::
shade=(yd<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
if(shade>32) shade=32;
if(shade<=0) shade=1; // <-<-<-<-<-------
curshades=shadetable[shade];


Kuki
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Wed Feb 18, 2004 4:10 pm
   Subject: Re: Shading tutorial bug report & fix
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You're right, there can be such a problem, if the LSHADE_fog value is too high and/or the sprites are too far away. For example if the LSHADE_fog value is 255 shade will become zero and there for 32 for sprites of 130 pixels height or less.
But you forgot to write the "shade=32-shade;" line Mr Green
Without this it would speak completely against all the stuff you said Wink
(I know the "added" line is important Mr Green)
But anyways, you're right, thanks for making me notice, I'll correct the tutorial with a small thanks Mr Green

Greets
Ripper
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 17 Oct 2016

Topics: 19
Posts: 370
Location: Northern Italy
italy.gif

PostPosted: Fri Mar 05, 2004 1:22 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, you can rip from the source code of my WolfenBots (on http://texzk.gameprog.it?sez=wb&pag=dn). It works properly. I haven't got any problem with shading, ouside atmosphere, fading and so on. Keep in mind that shading will reduce the far memory (I know what I say), so reduce the fading steps (-768 bytes every step reduced).
Hair Machine
DieHard SS
DieHard SS


Joined: 24 Nov 2003
Last Visit: 08 Jul 2017

Topics: 8
Posts: 431
Location: editing my profile
uk.gif

PostPosted: Fri Mar 05, 2004 1:38 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quick question: Does this tutorial support the ability to have shading in some levels but none in others? So, for instance, you might want an outside scene to be dark and eerie, while a castle scene would be bright and well lit (i.e no light shading)?

_________________
Rar rar fiddle di dee
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Fri Mar 05, 2004 3:28 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hair Machine wrote:
Quick question: Does this tutorial support the ability to have shading in some levels but none in others? So, for instance, you might want an outside scene to be dark and eerie, while a castle scene would be bright and well lit (i.e no light shading)?


Yes...

Check the routines and you will see switch (gamestate.mapon)... that is the cue... to turn it on or off... for each map that you list in that switch.

Greg
BrotherTank
Sockman
Don't Hurt Me
Don't Hurt Me


Joined: 19 Jun 2003
Last Visit: 24 Jun 2008

Topics: 3
Posts: 67
Location: City 17
usa.gif

PostPosted: Fri Mar 05, 2004 4:11 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Just throwing ideas out here, I have no idea how this would work. Since lights, lamps, etc. are defined to not be affected as shaded sprites, I have a few questions here:

1. Can this be modified for certain frames of guards? It's kind of stupid when the guard fires the gun and it is pitch dark. Obviously unrealistic.

2. Since lights have their own part in the code, could a GL style light shading system be emulated? I mean, that close to the light, it is full brightness, moving in pixel degrees away. We'll take 2 64x64 walls. Pixel #0 (all the way to the left) is at full brightness, while Pixel #128 (all the way to the right) shades normally. This occurs on textured ceiling/floor textures in the area as well.

_________________
This isn't revenge; it's punishment.
Hair Machine
DieHard SS
DieHard SS


Joined: 24 Nov 2003
Last Visit: 08 Jul 2017

Topics: 8
Posts: 431
Location: editing my profile
uk.gif

PostPosted: Sun Mar 07, 2004 9:16 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BrotherTank, are you referring to the part in Wl_Game.c where it generates the shade tables according to the user's specifications? Because I'd already tried just putting

::: CODE :::

case 1: break

for the level without lighting; but that doesn't work... It seems to use the shade table from the previous level. If you're referring to something else, I now look like an idiot.

_________________
Rar rar fiddle di dee
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Mon Mar 08, 2004 2:13 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Oh, no shading isn't supported at all! *OOPS*
OK, here's how you can do it:
In WL_PLAY.C add the following function after the GenerateShadeTable function:
::: CODE :::
void NoShading()
{
   int i,j;
   for(i=0;i<256;i++)
      for(j=0;j<SHADE_COUNT;j++)
         shadetable[j][i]=i;
}

Now you can use this function inside the switch statement in the PlayLoop function. For example:
::: CODE :::
      case 1: NoShading(); break;

Greets
Ripper
Hair Machine
DieHard SS
DieHard SS


Joined: 24 Nov 2003
Last Visit: 08 Jul 2017

Topics: 8
Posts: 431
Location: editing my profile
uk.gif

PostPosted: Mon Mar 08, 2004 1:33 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hey, thanks Ripper! Works perfectly (as always)! Apart from one thing... The file's actually WL_GAME.C, rather than WL_PLAY.C. Wink

_________________
Rar rar fiddle di dee
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Mon Mar 08, 2004 2:37 pm
   Subject: Re: [Info] Ripper's Shading Tutorial - Fixes
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hair Machine wrote:
Apart from one thing... The file's actually WL_GAME.C, rather than WL_PLAY.C. Wink

Sorry, but I refered to the current version of the shading tutorial which takes place in WL_PLAY.C because of demo stuff Mr Green
But this doesn't make any difference of course, if you didn't update, then it's completely right to put this stuff into the WL_GAME.C!
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Mon May 24, 2004 12: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

After all that time, I managed to fix that bug Kuki mentioned and add the noshading support.
You can view the new version at http://www.chaos-software.org.
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Thu May 27, 2004 11:24 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:
All your coding is way too advance for me, that's why i only use copy pasteing!


I have thought of this option, but since Borland 3.1 is DOS - based I have accepted that typing it all up line by line is the only option.

Please tell me how you do this - it would help me (and others) a lot!

_________________
"Listen and exchange with me, as we both share in common a different value system."
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

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

PostPosted: Thu May 27, 2004 11:42 am
   Subject: Re: [Info] Ripper's Shading Tutorial - Fix for Demos
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

sentenced wrote:
I have thought of this option, but since Borland 3.1 is DOS - based I have accepted that typing it all up line by line is the only option.

*.C and *.H files are just regular text. There's atleast two easy ways to copy/paste the new information.

1. Dos style: Copy and save the new code into a file (or just save it as a text file in your Internet Browser), then look for that file in Borland, and copy/paste it into the correct *.C or *.H file in Borland.
2. Windows style: Copy the new code. Open notepad, look for the file you need (ex. WL_DRAW.C), and copy the info into that file and save; then open Borland to compile it.

Try it out, it really works. Hope that helps. Smile
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Fri May 28, 2004 8:40 am
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Damn, I should have known that...

Still, thanks a lot Chris - now to add ceiling and floor textures (hopefully) to Nuclear Assasination!

_________________
"Listen and exchange with me, as we both share in common a different value system."
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 13 Nov 2017

Topics: 97
Posts: 1505
Location: New Jersey
usa.gif

PostPosted: Sun Jan 30, 2005 7:27 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Where do u put the "extern void near ScalePost();" & "extern void near ScaleLine();"

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Sun Jan 30, 2005 9:25 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Kyo Kusanagi wrote:
Where do u put the "extern void near ScalePost();" & "extern void near ScaleLine();"


Damn Kyo.... You really can't read the tutorials now can you?

And because of your question... I finally get to use a quote I've wanted to for a long time... You know the TV series Seinfeld? I am now the Code Nazi.... (based on the Soup Nazi).... lol....

Code Nazi wrote:
No More CODE for You!


You ever heard that other expression RTFM?? It's right there in the threads first post... In the WL_DRAW.C file replace the routines with the lines.... And then insert the two new routines into the "WL_SCALE.C" file...

Greg
BrotherTank
Code Jedi credo: May the source be with you...

PS: You definitely aren't Code (Jedi) Master...

_________________

The probability of someone watching you is directly related to the Stupidity of your actions
&
The two most abundant things in the Universe are Hydrogen & Stupidity - H.Ellison

Which of those is more relevant to you??
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Jan 30, 2005 10:17 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

YEAH. GO THE SOUP NAZI!!!!

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
IanFranken
DieHard SS
DieHard SS


Joined: 26 May 2004
Last Visit: 15 May 2014

Topics: 27
Posts: 411
Location: Amerika
usa.gif

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

LOL - "Code Nazi"! Laughing

I like it - You should include it in your signature or even make a new rank Wink

_________________
"All you people of earth are idiots! Stupid! Stupid!" - Plan 9 From Outer Space
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 13 Nov 2017

Topics: 97
Posts: 1505
Location: New Jersey
usa.gif

PostPosted: Mon Jan 31, 2005 1:59 pm
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

do i have to add the Shade_a.asm i did that i run BC 3.1 and i clik on build all when it get to the end it give me an error:"_scaleline defined in module WL.Scale.c is duplicated in module shade_a.asm" & "_scalepost defined in module WL.Draw.c is duplicated in module shade_a.asm"


Edit:nvm i got it to work

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 13 Nov 2017

Topics: 97
Posts: 1505
Location: New Jersey
usa.gif

PostPosted: Sun Feb 06, 2005 9:14 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 have a Question. How do u Change the color of the Shading?

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Sun Feb 06, 2005 9:26 am
   Subject: Re: [Code] Shading Tutorial & Fixes - Ripper
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Kyo Kusanagi wrote:
I have a Question. How do u Change the color of the Shading?


You read the first post in the tutorial thread where it says:

Tutorial Post 1 wrote:

You can later change the shading attributes to fit your needs. Here you can set the color in RGB (red, green and blue (0-255)) to which the colors will change in the distance and another attribute which results in a foggy effect for values around 5 (LSHADE_FOG).


It's talking about the lines:

GenerateShadeTable(15,15,15,&gamepal,LSHADE_FOG); break;

Where RGB refers to (RED - GREEN - BLUE) or:

GenerateShadeTable(R,G,B,&gamepal,LSHADE_FOG); break;

Greg
BrotherTank
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 1 of 3 Goto page 1, 2, 3  Next
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 2438 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 2381 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 1969 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 2700 Sun Oct 26, 2003 1:21 am
Guest View latest post
No new posts [Help] Different Enemy Dying Frames/Views
Author: Guest
7 607 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