Jump to content
Sign In to follow this  
Jasoncw

SC4 Shadows

11 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hello, 

As some of you might have noticed, the shadows from the BAT, and the shadows in the game do not line up.

So, I copied the lighting stuff and started my own modd.

At first, I thought that I would go into the BAT and find out the angles of the lights.  Then I figured I'd go into my modd and change the angles to match it.  Well, it turns out that the angles already match perfectly.  But for some reason they still do not line up in the game.

So I made a 2x2x40 meter object in the BAT, and I exported it, and put it on a lot for the game.  This was my test building.  then I made the same object in 3ds max (it has the same angles, but can have sharp shadows, instead of soft ones), and made a ground plane, so that I could see the shadow.

I did a preview render of the 3ds max object, and copied and pasted it into Photoshop.

Then I tweaked the lighting settings in my modd, and loaded SC4, took a screenshot, and lined them up in photoshop to compare the two.  Then I continued tweaking it until the shadows matched, and surprisingly, I got them to match really well.

So then I plop a new building of mine, Chase Tower, in SC4.  Chase Tower has a glass, set back lobby.  The shadows from the columns and the body of the building fall onto the glass lobby.  With the default in-game lighting, it is very noticeable that the shadows do not line up, and it makes the lobby area of my BAT visually confusing.

So I plop my building, and the shadow is really cracked out.  For some reason it rotated around, and nothing lines up at all.  It's ten times worse than it was in the first place.

So I was wondering if anyone knew what was up, and if anyone could give me some pointers.

I'm not 100% sure how the shadows are made in the game.  But I think that the game takes the opacity masks from the .FSH files, distorts them (into a shadow shape), and then fills in the shape with a shadow image/texture.  I think this because the BATs don't have detailed enough 3d information to create "real" shadows.

On the other hand, I typed in a negative number for one of the fields (sun pitch) once, and everything was dark, so I don't know how that fits in.

Anyway, any help would be appreciated.  If this modd can be made, it would really make BATs more integrated with their surroundings.  It's these little things, like shadow angles, that often make BATs feel separated from their environment.

Sorry for the long post.  3.gif


02Sxlbs.png    PATREON    •    MIPRO    •    MY BAT & TUTORIAL THREAD

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Hello, it's nice to see you!  I figured that you would be interested in this.

    This modd changes the angles and color of the shadows in the game so that they match the BAT's shadows.  To make BATs look more integrated with their environment.

    Here is a picture:

    http://img61.imageshack.us/img61/9311/shadowsproblemzf8.jpg

    The modd is just the properties of the sun from the game copied into a new file.

    At first I thought that I just had to change the angle of the lights to the angles in the BAT, so I opened up one of the rigs, took note of the angles of the lights, and then opened up my modd to change the angles, but they were already the same!!  But we both know that they do not end up being the same in the game. 

    So I made a 2x2x40 meter object in 3ds max (so that I could see sharp shadows), and in Gmax (so that I could export it, since I cannot currently do that for some reason).  I took screenshots of my object plopped in the game, and overlayed it with a screenshot from 3ds max, and I tweaked the angles until they matched.

    Then I plopped Chase Tower.  Chase tower has the set back lobby, and the BAT shadows from the columns are visible on the lobby behind, but with the default Game sun, the two shadows do not line up.  So I plopped Chase Tower, and saw that the new shadows are not aligned.  I noticed that the shadow was no longer aligned with the building.  I had not noticed it with the 2x2x24 object, because it is so skinny that it is hard to notice, but it is clear that this is a major issue.


    02Sxlbs.png    PATREON    •    MIPRO    •    MY BAT & TUTORIAL THREAD

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I think I just repeated what I said the first time.  Here is a screenshot of iLive with the modd open.

    lightmoddal8.jpg

    The two highlighted ones are what I tweaked.

    If anyone has any questions, please ask them and I'll try to answer them.  I think this modd could really improve how the game looks.  From the looks of things it seems like no one knows.  8.gif


    02Sxlbs.png    PATREON    •    MIPRO    •    MY BAT & TUTORIAL THREAD

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    When I set my shadows to high it looks the same ugly blobby crappy as the medium, so i always have it set to low.

    Help?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     

    This topic getting kinda old... but because we sort of started a discussion on it the 3ds max threads, why not continue it here...

    The fact that shadows can be changed is good amazing! 19.gif

    But the rotations... That looks kind of bad...  I'm gonna try my hand at this, see what I get out of this...

    Your way sounds very logical on how the shadows are formed, but maybe once the shadows are calulated, they are put into position using the s3d files and the settings in the that exempler file, because the fsh files can't tell where and how to position the shadows...

    I did some testing, and came up with a theory:

    As Jasoncw said, the fsh alpha mapping is used for shadow calculations, but fsh's are used for only 4 rotations, so the game probably takes the shadow off of a neighboring view fsh and builds it using its alpha map.  Then it positions and scales the shadow based on the sun location (pitch and angle) and a point in the lod.  Now, because the shadow must retain its shape (it's built on one group of fsh files), it will be rotated with a different sun location and not recalculated like we want to 15.gif.

    The only way I can think of is by changing the lighting rig in the bat files, but this will not fix the maxis originals and old bats, only new ones.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Well, I think that there is a way to completely fix the shadows.  Some of the other settings must control some other aspects that make a difference.

    I feel like if these things could not be meaningfully changed, it would have been put into the .exe.

    Also, it's worth thinking about, is that the default pitch and direction is the same as the BAT light rig.  I think maybe one of the other properties is deforming the shadows away from what we want. 


    02Sxlbs.png    PATREON    •    MIPRO    •    MY BAT & TUTORIAL THREAD

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     

    That's a very good point, but the question is, which property.  In my bat thread, Simfox says that there was a mod that streaches shadows.  Maybe we could instead of changing the sun's position just streach and deform the shadow into the correct position, if this is possible.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    God, how did I sort of missed this thread?? I saw the first message, but then completely forgot of its existence!!
    But now seeing your screenie from iLive Reader it gave me an idea. And I think I know where you've made a mistake!
    I can’t test this right now as this computer I'm on doesn't have game installed, but I'll test it as soon as I could.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections