Jump to content
Crimadella

Transparent, see-thru water, all the way

6 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hello, I figured out how to make transparent water...after many days of trying all kinds of tedious stuff and reading these forums. I'm new to mod ding but I'm a quick learner. It was actually a pretty simple thing once I figured it out. What I mean by transparent is you can see the entire bottom, I have a black sand plopable prop that can go under water, I can dig a hole all the way to the lowest point, the very bottom, and plop a line of the black beach sand from above sea level, down to the deepest portion then beck up above the land and see it all. It doesn't work for the sides though but you can control the color and how see-thru it is.

The trick is to add an alpha channel. The original maxis water textures are lacking the alpha channel. It only works for the 300s (09187300-09187304). If you shade it a different color, like green, you have to adjust the 13's (00000013, 113, 213, 313 & 413) to a darker shade. It's a little tricky getting the shade right because when you combine the Alpha channel with the shade of your 300s it lightens the shade. I just prenamed the bmps with the TGI as if GoFsh extracted them, (7ab50e44-891b0e1a-09187300-C0) & a separate bmp for the alpha channel (-A0), then load it up, open the color bmp with GoFsh, the alpha file will load itself if named properly with the "A0" extension, then GoFsh will merge the two and show what shade of your color it will produce(the color lightens once merged with the alpha). Then Adjust the sides, c9efb727 & 69efb6f8, to match the shade of the alpha and colored picture merged (I just used solid colors because if you use a pattern it just doesn't look as good to me, I tried that but didn't like it).

After seeing the shade (I just kept it open in GoFsh), make the 13's much darker, make the two sides, top(6f8) and bottom(727), the same shade as the merging of the 300 with its alpha. Then, you can try to adjust you 14's however you like (for the base of the shallow water). As far as I know, all the alpha channel is, is gray, how dark or how light it is will effect how transparent the water is(lighter gray alpha = more opacity, etc). Even at 90% opacity I could still see the black sand run across the deepest part of the sea, as low as its possible to make it, with a dark color as a test (dark green with 90% opacity), while 50% opacity was very easy to see the entire floor of the sea, so much that I had to go ahead and smooth it out with the smoothen god mode tool.

Pictures attached, I think they'll show?

It doesn't seem to work for anything but the 300s, the sides do not become transparent when adding alpha images  (as far as I know). To get the original alpha, I opened my solid or textured image in GIMP 2.10, adjusted the opacity to the desired level of transparency, duplicated the alpha channel, copied it and pasted as a new image. For some reason, when I tried to save the two images seperately (an alpha bmp and a colored bmp, GIMP would make both of them the alpha photo (I'm new to even knowing what an alpha is). I also have Paint.net, so I just made my color photo in that one and used the alpha I saved from GIMP, when I color picked the alpha in Paint.net, it was simply one solid shade of gray, so for the other apha channels, the 16x128's, I just resized the photo but never achieved transparency for the sides, so I just matched the colors with my color bmp(after merged with the alpha in GoFsh). I tried to go all out with multiple shades, hoping I could fade the sides down from blue to dark green but as far as I can tell it had no effect(other than making the sold sides not match the tent of the see-thru water). Merging the 16x128 alpha with the side colors still gave the lightening effect so I simply removed those alpha channels. In the end it seems that only the 300s can handle the additional alpha channel to add full transparency.  More than likely, all you have to do is make a gray bmp to merge with your 300-304 main water textures (or solid colors) in GoFsh, put the 'A0' on the end with the proper TGI's and it will build the missing alpha channel for the main water textures and apply full shaded transparency in-game. Maybe that's how pipe mode works? Without the tint? Anyway, that's about it. I would upload them but it's a fairly simple process to make, the end result is nice though. I may try 95% opacity tomorrow, I still like to use GIMP for the creation of the alpha channel, just so you have a measurement to go off of, like specifically setting the opacity to 90% to get the right shade of gray rather than guessing, you can tell a difference, a rather significant, from 50% opacity to 90% opacity. It was much harder to see the full shape of my sea floor at 90% opacity while the photos attached are at 50%, while it has color, that just seems a little overboard, too unrealistic . I'm going to see what 95%+ looks like tomorrow, it should look more realistic.(also making more realistic shades, these basic colors were for testing, you lose patients when packing hundreds of dats with fsh files in 4 days, so these colors were just slapped in for testing purposes, now that I know how to get the desired effect, I will spend more time making a few shades that look more realistic, perhaps a blended color so it's not like stained glass)5ea7b3a9d0e1d_NewCity-Jun.26001588044653.png.73500501f8f559118d7f7b1a6e128821.png5ea7b3854e357_NewCity-May.26001588043819.png.ded48c7d902c8cf30d9399e1d36b872f.png

  • Like 7
  • Thanks 1

Share this post


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

Well done on finding that alpha trick on the 300 textures - I don't think that was widely known and the game certainly doesn't use it out of the box. SC4 will do alpha blending near the coast but this is certainly a way to get it everywhere. I agree it looks a little weird though as real water is essentially opaque after about 50m even in very clean waters. However I imagine this could be used to good effect for lakes or ponds and even to get subtle effects at the coast edge.  

  • Like 7

Share this post


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

    Thanks. I'll upload a couple more pictures today after I get something better made. Increasing the opacity makes it harder to see through (more realistic), at 90% (with a dark solid color (green)) you can't see the entire bottom, I didn't even think it was still transparent at that level, the only thing I could see at that level was the black sand running across the floor of the sea, so while I could still see the black sand plop at any depth, it was the only thing I could see. I have to have my real plugins folder in to plop the black sand, so just to share the basic principle and show that you can make it as transparent as you desire, I set it at 50% to show here. Once I get a more realistic texture put in, likely today, I will show what it looks like with a decent color and higher opacity, with my real plugins folder in so I can run the black sand across(I have too many plugins to sift through to find the plopable sand in a decent amount of time and the loading takes too long for testing with all plugins loading). I'll try to take some basic depth measurements to show at what depth from maximum sea level it becomes every difficult to see the bottom. With that test, I couldn't see all the hills on the ocean floor, so basically you can use this method to go full transparency or increase the depth of transparency. The maxis water textures without an alpha are only transparent for a depth of about 25m, once you run black sand down those banks without an alpha, you can't even see the black sand past 25m deep. I had almost given up, I has been trying everything for like 4 days, adjusting properties in the terrain properties, trying multicolored water fades, they all turned out not that great though. No matter what I tried, I could not increase the transparency of the water at all, tested with the TerrainQuery cheat. My tests with multicolored water also didn't work out well, I shot for a Blu surface fade down to a green bottom, while it does work for the sides, the 6f8 just blends in with the 300s thus causing the 727's top end of the gradient to not match the overall color of the water. I'm going to alter the color of the maxis 300s to see how it looks with more opacity with an alpha channel, it will propably look a little better with a blended color (like the original maxis 300s) rather than just a solid color or a water texture with well defined aspects (like waves). I tried it with a custom water texture, but it just painted the texture all over the sea floor, just looked too repetative for my taste. So it will likely look much better with just a faded texture(like maxis textures (300s)), to add a little variance to the water color, I will try to make my own, I'm not that great with making textures though I did watch a few GIMP tutorials yesterday and they have a very powerful tool for making custom textures (make seamless). I'm very creative, just not fimilar with using the tools to make custom textures. My water texture turned out alright, it just doesn't look good in-game, I don't like seeing fixed patterns on my water.

    • Like 3
    • Thanks 1

    Share this post


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

    Well its good to see you try - the only way to get good at making textures is to make a lot of them.

    In the beginning you're still working out how to get the tools to do what you want, after that you start to understand what the game does with them, and after that you start to get wise to making good textures. It takes time. Also, I've found sometimes you need to make something, live with it for a while and only then try to improve it. 

    Getting textures to tile cleanly at all scales without eye-catching patterns is one of the hardest things to do. Humans have really good image processing for lines and shapes especially on horizontal, vertical and diagonal lines so even if it looks good at one scale, it may tile badly at another zoom. Its possible to disguise repeats by staying off 0,45,90 or going random and fixing the edges by hand - but 95% of the textures you make will be flawed to some degree - I've been there.

    You also won't find much useful on the NET, as the textures are the wrong scale, or too artificial for SC4, and most are just plain awful - having color gradients or over obvious blobs etc. But as they say, Happiness is the Road.

    • Like 4

    Share this post


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

    Wow, My pictures that I uploaded look way worse on my computer than my phone, i didn't know the pattern was so visible. Anyway, its going to be a while for me to create a good texture for it, no matter what i try it just looks similar to the previous pictures, which were actually solid colors but I used the alpha from the water texture i had made, that's how the pattern ended up on those pictures, it wasn't visible in-game. Perhaps to give it a fade between shades I could just alter the alpha to make some portions more light and visible than others. That may take a while for me to get to though.

    All I've been doing for the last 5-6 days is messing with these water files, it took a lot of work to get the sides to match up with the shade I used in these new photos, seems like they kinda made it more difficult than it should be. With the side gradients, both the shade an hue is offset, so you can't actually just use the same color or it will not match up. The side gradients also appear to be blending with something else, I had to make them almost completely black to match up with my main water color, in-game they are much lighter than the actual image file. The shallow water appears a little more patchy with transparent water, i'm not really sure how to resolve that one, probably just a matter of getting the shade right for the 14's.

    In these photos, the only ones i'm lacking are the 13's which color the top of the water meeting a shore that is pointed in the opposite direction of your viewpoint, that's where the blue glow is coming from in these photos. In one of the pics, I ran a line of black sand through to show that the water is transparent, in another I put a mountain slightly rising out. This one looks a lot better to me, it's transparent but is difficult to see all the way through. I adjusted the shading of the alpha in another program so the opacity is somewhere between 90% to 95%. I'm going to go back to building for a little while and take a break on this water project. Anyway, here are the photos...

     

    Huh, its showing a pattern on these photos also, not sure where that's coming from, that pattern isn't visible other than in these pictures. The main water color is solid and so is it's alpha, so in-game, it looks way better than these photos. The two pictures in the same position, one has the black sand ran across, the other has the mountain brought up in the middle. See the blue glow on some of the edges, the banks pointed away from your perspective? Those are the 13's, the last ones i have to do.5ea9abde02ede_TestCity-Mar.28021588175647.png.9a1dd8e2f8eec471a4f7efc6609c2de1.png5ea9abebe38aa_NewCity-Apr.29071588176119.png.8153e9511b049b96db599b3733b798b2.png5ea9ac48273f2_NewCity-Apr.29071588176210.png.e2695084c0ab593f441f21bf5ea6c2db.png5ea9ac14ae6a4_NewCity-Apr.29071588176246.png.edcfcd571e0990f7f760e94ebf412087.png

    New City-Apr. 29, 071588176153.png

    • Like 4

    Share this post


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

    The patterns are caused by the autofit resize on display on the web page - the best way to avoid that is to use cropped images that are not wider than 1024. Still the full size images when displayed are OK.  They demonstrate the effect you were going for.

    • Like 2
    • Thanks 1

    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


    ×

    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