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       

[help] Parallax sky horizon line in SDL
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
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Sat Oct 09, 2010 4:13 pm
   Subject: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

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
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Mon Aug 15, 2011 5:40 pm
   Subject: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
<B>Moderator</B>


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

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

PostPosted: Mon Aug 15, 2011 6:31 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 13 Sep 2018

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

PostPosted: Mon Aug 15, 2011 7:27 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Mon Aug 15, 2011 10:30 pm
   Subject: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
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...


Yeah, that's what I meant. Make the Parallaxing sky appear through it and make the wall invisible, but still physicaly there. My current code does not do either.

I also tried out what you suggested and I ended up with the exact same results:

[img]http://tiny-brain.deviantart.com/art/Parallax-Sky-Bug-253163932[/img]

I got that result with my original code. It seems that all the code does is erase the wall tiles that would be there. However, it may be my fault. I'm setting the tilehit to 200, is that bad? (Is it a floor, or does that not matter at all?)

_________________
- Taking a hiatus from Wolfenstein for a while...

...But I'll be back, you can count on it!
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 13 Sep 2018

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

PostPosted: Tue Aug 16, 2011 12:01 am
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Metalor wrote:
Yeah, that's what I meant. Make the Parallaxing sky appear through it and make the wall invisible, but still physicaly there.

Ok, cool. I don't think it matters what tile you use... as long as it's a wall (1-63 in the original wolf3d). 200 would only go to the HitHorizWall/HitVertWall sections and work if you increased all the MAXWALLTILES code to have over 200 wall tiles too.

By the way, this is what the code above looks like when I tried it in a fresh copy of Wolf4SDL:




The see-through areas are the Gray Stone 1 walls (this is the left room after the brown area in E1L1).
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Tue Aug 16, 2011 8:24 am
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Tue Aug 16, 2011 8:45 am
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Tue Aug 16, 2011 5:01 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
<B>Moderator</B>


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

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

PostPosted: Wed Aug 17, 2011 5:20 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Wed Aug 17, 2011 6:51 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
<B>Moderator</B>


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

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

PostPosted: Thu Aug 18, 2011 5:59 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Metalor wrote:
Merely copy and edit the Parallax Sky data so that it activate under the Bottom Right and works on the floor instead?
I'm sure that's doable. I'm just not 100% sure how to get the vertical position just right, as I haven't fussed with that part of the code yet. The trick is getting it so that both parallax sky and floor don't appear one or two pixels apart on alternate resolutions (or overlap each other, either). Something tells the code to "stop" drawing after doing the last row of pixels for the parallax sky. A good strategy - IMO - is tell it *not* to stop there, but to keep going, only it starts drawing using the textures for parallax floor, not for the parallax sky. I could have it calculate the pixel coordinate for the parallax floor each time it draws a pixel for the parallax sky, but it'd be v-e-r-y slow. Smile
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Sat Aug 20, 2011 5:08 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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
<B>Moderator</B>


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

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

PostPosted: Sat Aug 20, 2011 8:45 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

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


Joined: 24 Aug 2005
Last Visit: 14:20 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Sat Aug 20, 2011 9:01 pm
   Subject: Re: [help] Parallax sky horizon line in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

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!
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 [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 10853 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 2998 Sun Jul 20, 2008 7:56 am
Haasboy 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
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 3266 Tue May 06, 2008 1:15 pm
Ripper View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 4478 Sun Apr 27, 2008 2:30 am
AlumiuN 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