Jump to content
Eternal Lands Official Forums
Roja

Colored Water

Recommended Posts

Ok I have been asking Entropy to make different colored water for 1.5years now(no exaggeration). So, I'm asking on here because maybe it is something someone else can do? I will supply all art we need to make it work of course, and/or the exact colors of different water types.

 

Basically we need a couple different blues, to give variety, a green and brownish for swamps, purpleish too... and maybe a few more when I think of it.

Share this post


Link to post
Share on other sites

could we use glTexEnv to give it any color? the textures would be greyscale then, just to give the water surface a structure. and u could save a color for each tile.

mapformat would have to be modified though. and when doing that why not add a fog and other effects.

Share this post


Link to post
Share on other sites

Is it enough if you can have one type of water per map, or do you need to select per tile? If it's enough to change it per map, I think it should be easy enough to change it so that you can select water texture for each map you make. We almost have support for this already, since the water texture is different in dungeons and outside levels.

 

Per tile would be quite a bit trickier - more code to change...

Share this post


Link to post
Share on other sites

Well, since this would need an update to the map format anyway, I think we should try to get it right from the start.

 

Currently the tiles work like this: Every tile has a value between 0 and 255. 0 means it's water, and hence is rendered in a special way, and 255 means it's a "null tile," i.e. nothing is rendered there. Anything in between is just ground. This is how it's stored in the map files, and this is how it's stored in memory.

What we need to pull this off, is to add more information to each water tile or make more of the 255 available tiles water.

We could simply reserve something like 230-254 for new water tiles; this might be the solution that requires fewest changes in the code.

Hmm... I had a couple of other possible ideas, but that one might be the easiest to implement and should work well. Any comments?

 

frak: The reason I want different textures instead of vertex colors is that if we used the latter solution, shadows would always be grey on water, no matter what water color we have. Might not be a big deal, but anyway... (And I know no one asked, but I anticipated a question :angry:)

Share this post


Link to post
Share on other sites
Well, since this would need an update to the map format anyway, I think we should try to get it right from the start.

 

Currently the tiles work like this: Every tile has a value between 0 and 255. 0 means it's water, and hence is rendered in a special way, and 255 means it's a "null tile," i.e. nothing is rendered there. Anything in between is just ground. This is how it's stored in the map files, and this is how it's stored in memory.

What we need to pull this off, is to add more information to each water tile or make more of the 255 available tiles water.

We could simply reserve something like 230-254 for new water tiles; this might be the solution that requires fewest changes in the code.

Hmm... I had a couple of other possible ideas, but that one might be the easiest to implement and should work well. Any comments?

 

frak: The reason I want different textures instead of vertex colors is that if we used the latter solution, shadows would always be grey on water, no matter what water color we have. Might not be a big deal, but anyway... (And I know no one asked, but I anticipated a question :))

Char value - I see.

Well, judging from our lack of available tiles at the present, we should have room, just have to do grunt work. Personally, I think it's the way to go.

Share this post


Link to post
Share on other sites

i think they will get mad if i start making textures at work :o

 

just make your test things then i'll replace them when i get the new editor/client B)

Share this post


Link to post
Share on other sites

The CVS server seems to be working quite bad at the moment, but I finally managed to commit the changes for both client and editor.

What you will need to do to get it to work is:

Move textures/sky.bmp to tiles/tile0.bmp

Move textures/water2.bmp to tiles/tile231.bmp.

Any new water textures should be called tile232.bmp... to tile 254.bmp. If more water tiles are needed, it's easy to change (the macro is_water_tile in reflection.h)

To avoid having to update existing maps, tile0 is automatically replaced by tile231 in dungeons.

The new water tiles might still look quite blue; that's because they are blended with a background that is blue in the middle of the day. To change this behaviour, we'd simply change the alpha value for the water tiles in load_map_tiles().

 

Tile selection for the editor has been slightly updated. You can now use keypad - and + to select which "page" of tiles you want to view. It'd of course be nice with a scrollbar and stuff, but I'll leave that to someone else.

 

EDIT: Regarding the alpha value, it might be better if we didn't set it explicitly in the code, but rather saved it in the different water texture. This way, we could have different transparencies for different kinds of objects.

Edited by Umrion

Share this post


Link to post
Share on other sites

hm... ok so i can't change that alpha value? I'll test it out as soon as I get a new map editor...could be a few days, i dont know when :D

Share this post


Link to post
Share on other sites

Ok Sadez sent me the mapeditor(thankyou!! B))

 

Works great, except the normal water tile doesn't look like it used to. I guess I have to directly change that texture, right? Because now it works different?

The lava looks awesome btw :)... i'm gonna have some fun :D

 

Thanks guys!!!

 

 

edit: oh and i didn't see any problem with the tiles being too blue or something. They look just fine :)

Share this post


Link to post
Share on other sites

Oops. The normal water looks like before - in game. I forgot to change the load_all_tiles() function in the map editor <_< Sorry about that.

(This means the water tiles don't get the same alpha in the map editor as in the game.)

 

I'll make a new commit in a minute.

 

Anyway, the alpha value is included in the code, so you'll have to ask a coder to change it for you. The better solution, to include alpha in the texture, would require us to change format (from bmp to png, tga or whatever) since I don't think bmp supports alpha.

Share this post


Link to post
Share on other sites

Well like i said, if it stays the way you made it when i just tested it, it looks fine, great, nothing needs to be changed :D

I just have to manually adjust the water texture, which isn't a prob.

 

So what you're saying is is that you do have to change it again? so what i just saw now won't be that way?

Share this post


Link to post
Share on other sites

I already changed it. What you saw was water textures with alpha 255 (maximum) which meant that the water used all of the texture color but no reflections.

Water alpha is currently 70, which basically means that 27% (70/255) of the water color comes from the texture and 73% comes from reflections (the blue sky, and other things.)

Share this post


Link to post
Share on other sites

ah ok :D

 

So that is why you said that they will all have a blue tint? That'll be a problem for some things like the lava and swamp water. Anyway to use different textures for the sky reflection?

Share this post


Link to post
Share on other sites

We really can't do that :D To simulate the sky reflection, we do two things: We have cloud reflections on the water texture (and this is what's now the different water tiles,) and we draw a sky color.

The sky color is drawn first, and is simply a large quad over the whole window. To change this to be different for the different water types might be a bit complicated.

What we could try, is simply to increase the water alpha to something like 140, which would mean less sky color and more water texture color. It would also mean less color reflected from objects, though.

 

Why do we want to use this to model lava anyway? I wouldn't imagine lava is that reflective, so we might as well use normal tiles for it. Right?

Share this post


Link to post
Share on other sites

I just want the lava and swamp water to move some..so it looks like what it should.

 

Like i said, with the map editor i just tested, the swamp & lava waters were PERFECT..they do not need reflections at all, only the real water needs reflections.

 

But well i'll just wait until i get hte updated mapeditor to make anymore comments on it, until i really know how it looks :D

Share this post


Link to post
Share on other sites

Ok, then I get it. We could do it like this:

"Real" and dungeon water reflect, with alpha 70 as before.

All other "water" types don't have any reflections, and hence aren't blended and look exactly as what you saw now.

It's not as good as specifying alpha in the texture, but better than the current solution, I think. :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×