Author |
Message |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Sat Oct 09, 2010 4:13 pm
Subject: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

 
|
|
I saw this somewhere and I was curious on if there wasn't already a toggle in the SDL code to ignore certain wall textures to allow the horizon line to show instead of those walls with a special tile toggle.
If not, how would I go about programing this into the SDL code? |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Mon Aug 15, 2011 5:40 pm
Subject: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
I recently tried stitching this piece of code into the HitVertWall and HitHortzWall functions in WL_DRAW so that the parallax skies would stretch on into the horizon, but my efforts ended up with just an empty tile space that was basically an open floor tile.
::: CODE :::
if(tilehit==AREATILE-1)
{
if(lastside!=-1) ScalePost();
lastside=-1;
postwidth=1;
postx=pixx;
wallheight[pixx]=0;
return;
}
So that didn't work, and I tried modifying it just a bit to this:
::: CODE :::
if(tilehit==AREATILE-200)
{
if(lastside!=-200) ScalePost();
lastside=-200;
postwidth=1;
postx=pixx;
wallheight[pixx]=0;
return;
}
Which turned out to be basically the same thing, and netted me with the same result.
Can anyone help me figure out how to stretch the Parallax sky into the horizon? Any help would be much-appreciated. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 3:06 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
Posted: Mon Aug 15, 2011 6:31 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
I'm not really clear what you're trying to do. Are all walls and sprites supposed to be invisible through the wall in question? |
|
|
 |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 14 Feb 2019
Topics: 55
Posts: 2169
Location: Canada

|
Posted: Mon Aug 15, 2011 7:27 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
I didn't completely understand the question either (open "floor tile"... ?).
But here's a quick hack to make Wall 1 (Gray Stone) blank, and make the parallax sky go through it...
Open wl_parallax.cpp and change this:
::: CODE :::
int texoffs = TEXTUREMASK - ((xtex & (TEXTURESIZE - 1)) << TEXTURESHIFT);
int yend = skyheight; // - (wallheight[x] >> 3);
if(yend <= 0) continue;
Then open wl_draw.cpp and add this:
::: CODE :::
void ScalePost()
{
int ywcount, yoffs, yw, yd, yendoffs;
byte col;
if (tilehit == 1) return;
#ifdef USE_SHADING
Now scroll down to the ThreeDRefresh() function and change the order so that DrawParallax is run before WallRefresh:
::: CODE :::
//
// follow the walls from there to the right, drawing as we go
//
VGAClearScreen ();
DrawParallax(vbuf, vbufPitch);
WallRefresh ();
// random code removed
//
// draw all the scaled images
//
DrawScaleds(); // draw scaled stuff
There are smarter ways to do this using more code changes, but let me know if I'm on the right track. |
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
|
 |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 14 Feb 2019
Topics: 55
Posts: 2169
Location: Canada

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Tue Aug 16, 2011 8:24 am
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
If that's so, then perhaps it is the wall texture itself. I'll try setting it to something lower and see if I can get better results. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Tue Aug 16, 2011 8:45 am
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
Yep, that did it. Merely changing the wall from #200 to #64 did it (I recently bumped up the max walls to something like 96). Thanks for you help, it is much appreciated! |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Tue Aug 16, 2011 5:01 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
I do have one more question regarding Parallax Skies. I'm currently curious in adding a Parallax sky for the floor as well (so, Parallax Floors then). I've read the original code changes on how to do this, but I'm wondering how to implement it in SDL, and to allow it to function seperately from Parallax Skies. That way, I only have Parallax Floors on levels where I want/need it.
Any suggestions? |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 3:06 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
Posted: Wed Aug 17, 2011 5:20 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
I don't have such code with me, but thanks for mentioning this. I actually plan to try enabling a feature where both "parallax sky and ground" are functioning at once (I keep forgetting to jot it down so I'll remember). It might not work like the 16-bit tutorial; in my version of the code, the parallax sky can't be disabled without disabling the "parallax floor" as well. The parallax floor uses the 16 textures after the parallax sky textures.
In the past, DoomJedi had expressed interest in such a feature as well. It was for an abandoned Team RayCAST mod, though. |
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Wed Aug 17, 2011 6:51 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
Well, I just kinda want the feature because it works in like Space-esq levels or even in Floating sky cities or something to that effect. But I wanted to have freedom to just pick one 16 set or another without them having to be in any particular order within the VSWAP. One thing I noticed is that I haven't used the BottomRight corner in the Feature Flags data, so would it be possible to simply use that as a toggle?
Merely copy and edit the Parallax Sky data so that it activate under the Bottom Right and works on the floor instead? I know that idea may be plausible, I just don't know how to change the Parallax Sky routine to accomplish this. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 3:06 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Sat Aug 20, 2011 5:08 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
If nothing else, is there a way to simply stretch the Parallax Sky so that it will appear in both the sky and floor regions (Kinda like how Doom does it) so that you can make it appear like you're walking around space or something? |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 3:06 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
Posted: Sat Aug 20, 2011 8:45 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

  
|
|
I'm sure this can be done, but with the image 100% taller than it was before, it'll definitely look strange.  |
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:00 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Sat Aug 20, 2011 9:01 pm
Subject: Re: [help] Parallax sky horizon line in SDL
[ IP : Logged ]
|

 
|
|
Hmmm. Yeah, I dunno why, but I guess I assumed that the image would stretch both ways, but now that I rethink it, that wouldn't work right I guess. Not unless I cut the Parallax Sky's texture count in half. But then, it'd look weird on levels that wouldn't use it. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
|