Page 1 of 1

Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 09:10
by Beherith
Recently many maps have only small bits of water on them, mostly for visual effect. I would like it if we had an SMD tag that culls all water planes beyond the map boundaries, so the whole map boundary isnt rendered with water. Currently only water 0 obeys map boundaries
Thanks

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 09:14
by jK

Code: Select all

endlessOcean = (!!configHandler->Get("BumpWaterEndlessOcean", 1))
          && mapInfo->water.hasWaterPlane
          && ((readmap->minheight <= 0.0f) || (mapInfo->water.forceRendering));

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 09:15
by Argh
Does that work on water 1 / 3, though?

<tests>

No. And it doesn't really cut off all rendering past the map border, either. There is a wavy reflection still.

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 09:21
by Beherith
Sorry, Im really thick; but i tried the smd tag:
BumpWaterEndlessOcean=0;
In the water section of smd, and it did nothing, could you please elaborate on the correct usage of this command?

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 09:26
by Otherside
afaik its a option on spring settings not on individual maps

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 09:34
by Beherith
Ah I see, could it be used on a per map basis?

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 12:07
by jK
Beherith wrote:Ah I see, could it be used on a per map basis?
jK wrote:

Code: Select all

endlessOcean = (!!configHandler->Get("BumpWaterEndlessOcean", 1))
          && mapInfo->water.hasWaterPlane
          && ((readmap->minheight <= 0.0f) || (mapInfo->water.forceRendering));

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 13:19
by Tobi
What he means is, remove the 'planeColor' tag from the water subtable in the SMD, that has same effect as setting BumpWaterEndlessOcean to 0 in the user settings.

(Not everyone can read C++ and knows the spring source by heart...)

Re: Force water rendering only inside map boundaries

Posted: 11 Sep 2009, 14:07
by Beherith
It works just as advertised:

Remove the
WaterPlaneColor=0.113 0.085 0.015;
tag from your SMD file, and the water will only render to the map boundaries

Thank you all for the help! Ill move this thread to mapping now as that seems its logical place.

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 15:28
by Forboding Angel
Well fuck me, nice find behe!

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 15:48
by lurker
Nice find who?

And I don't see any need to be able to read code. It has the following English:

config something BumpWaterEndlessOcean
map info has water plane
map min height something
map info water force rendering


Basically, Beherith saw the first one and made a valid if mistaken effort at it. He should have then gone on to the other three. "has water plane" leads directly to trying to remove water plane from the smd.

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 17:22
by FLOZi
lurker wrote:Nice find who?

And I don't see any need to be able to read code. It has the following English:

config something BumpWaterEndlessOcean
map info has water plane
map min height something
map info water force rendering


Basically, Beherith saw the first one and made a valid if mistaken effort at it. He should have then gone on to the other three. "has water plane" leads directly to trying to remove water plane from the smd.
You don't see a need to read code because you can.

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 18:08
by Tobi
lurker wrote:Nice find who?

And I don't see any need to be able to read code. It has the following English:

config something BumpWaterEndlessOcean
map info has water plane
map min height something
map info water force rendering


Basically, Beherith saw the first one and made a valid if mistaken effort at it. He should have then gone on to the other three. "has water plane" leads directly to trying to remove water plane from the smd.
You have to know !! means not-not, which is just shorthand for conversion to boolean, you have to know && == and, you have to know || == or and you have to not be scared for formulas.

Besides that it isn't necessarily obvious that no water plane exists if a color has not been defined for it; many tags in Spring use a default value instead of using the existence of the tag as implicit configuration mechanism.

(For example, if you don't specify nano particle color in FBI a unit will still emit nano particles if it's a builder - it just uses the default color.)

Either way, I think it's obvious that quoting code is often not the best way to explain things.. (at best it gives a hint so someone who also happens to be able to make the same assumptions quickly can translate it into a better explanation.)

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 18:29
by lurker
Tobi wrote:You have to know !! means not-not, which is just shorthand for conversion to boolean, you have to know && == and, you have to know || == or and you have to not be scared for formulas.
No you don't. I didn't even read the logic symbols when I looked at it. I looked at the words, the single = sign, and the <=, and the <= was gratuitous. I completely ignored the booleans, the parentheses, the !!, the quotation marks, the semicolon, that non-map-related word "Get", etc. In fact, I still haven't read the 'code' part of it as I make this post. Isn't everything I put in my first post just the words of the snippet plus a few 'something's?

And no, it's not immediately obvious what to do when you're trying to make it have no water plane, but you should see the 'water plane' tags and try something.

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 19:06
by FLOZi
lurker wrote:
Tobi wrote:You have to know !! means not-not, which is just shorthand for conversion to boolean, you have to know && == and, you have to know || == or and you have to not be scared for formulas.
No you don't. I didn't even read the logic symbols when I looked at it. I looked at the words, the single = sign, and the <=, and the <= was gratuitous. I completely ignored the booleans, the parentheses, the !!, the quotation marks, the semicolon, that non-map-related word "Get", etc. In fact, I still haven't read the 'code' part of it as I make this post. Isn't everything I put in my first post just the words of the snippet plus a few 'something's?

And no, it's not immediately obvious what to do when you're trying to make it have no water plane, but you should see the 'water plane' tags and try something.
Or, Jk could have just given a straightforward and clear answer in the first place, and we would have avoided this pointless discussion.

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 19:31
by lurker
And probably with less effort then quoting the code.

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 19:50
by Beherith
Where I screwed up the interpretation is at the word waterplane. To me the word water plane means the very top of the water, not the ground beneath it. (even though i knew full well what waterplanecolor did in spring :? )

Also, im used to being given info in code, but i usually just keep asking till someone can tell me what it means :)

Anyhow thanks for the info guys, its a really good peice

Re: Force water plane rendering only inside map boundaries

Posted: 11 Sep 2009, 23:41
by lurker
But it does refer to the very top of the water in spring, what's the confusion?

Re: Force water plane rendering only inside map boundaries

Posted: 12 Sep 2009, 04:02
by Beherith
lurker wrote:But it does refer to the very top of the water in spring, what's the confusion?
Gotcha :wink:
It doesnt. It refers to the extended ground plane rendered under the water.
Which is why I was confused.

Re: Force water plane rendering only inside map boundaries

Posted: 12 Sep 2009, 22:20
by momfreeek
imo, sides should be rendered at the map edges (in some flat, boring color i guess) so you see the map as a solid chunk of ground rather than a paper-thin floating layer.