Animated Water Shader in WebScene

5959
12
07-15-2013 01:29 AM
MatthiasBuehler1
Frequent Contributor II
[docs provided by Andreas Ulmer ]


Hi all,

some additional hints on the water shader in CityEngine Web Viewer:

the following substrings trigger the water shader in Web Viewer:
<something>__water<something> (default wave params)
<something>__waterquiet<something> (slower wave speed, less amplitude)
<something> __waterstormy<something> (higher wave speed, more amplitude)

e.g.
"myShape__water"
"myLayer__waterstormy"

these strings can be set either on a shape name or a layer name. When set on a layer, all objects in this layer will get the water shader.
When setting the substring to shape names the export settings of these shapes need to be set to interactivity: pickable for the Web Viewer to pick it up.
When set on a layername, the __water* substring will be removed from the layer name displayed in Web Viewer.


when using CGA the water material can be specified using the substring "__waterparams" in material name:
set(material.name, <something>__waterparams_<wavesize>_<wavespeed>)
set(material.name, "watermaterial__waterparams_2_5")
set(material.name, "watermaterial__waterparams_5.5_10.2")
avoid params with more than one number after the dot (e.g. don't set "waterparams_5.50_10.21")

the values used for the __water* strings above:
__water: wavesize: 7, speed: 10
__waterquiet: wavesize: 2, speed: 5
__waterstormy: wavesize: 15, speed: 30
Tags (3)
12 Replies
nicholascarrington
New Contributor
That is nice, can you make it transparent and control the direction  of the waves?  ;)
0 Kudos
MatthiasBuehler1
Frequent Contributor II
==> on wishlist.

m.
0 Kudos
nicogis
MVP Frequent Contributor
Here I put a demo with lake water shader created dinamically from soe arcgis server. In this demo I create a skyline: click on a point and click 'generate skyline' and waiting about 60sec then the link of scene is shown in a toaster (bottom-dx).

http://sit2.sistemigis.it/js/skylinevco/
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Ciao Domenico,

[ come stai ? :) ]

Seems a cool thing !

Though I can never open the WebScene due to an error.

If we all update to http://www.arcgis.com/home/item.html?id=38fede3935a440e49cf316dcae6aae47,
we may be able to track the issue down better.

Let me know.
0 Kudos
nicogis
MVP Frequent Contributor
Hi Matthias, I have already updated (2.3.1) but I also haven't errors with 2.3.0. Have you the error when you open the file 3ws?
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Sure, here's the screenshot.

It says basically that it can not load the .3ws. ( sorry, it's in german ).

Even one of our 3ws developers could not open the file .. hmm.

Can you PM me your mail address, then we can track this down.

Ok ?

m.
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi,

ok, tracked down. seemed to be a security issue within our network. ( 3ws ( zip files)).

m.
0 Kudos
nicogis
MVP Frequent Contributor
Ok, thank you.
In your print screen I have seen error 403 HTTP and I think that it can be related at firewall.
0 Kudos
KathrynAngleton
New Contributor III

Can you change the color of the water? I've been using the __watercalm to generate water in a rendering of redevelopment along a river, but the river is actually a blackwater river, so it would be an added bonus if I could change the color to a dark brown while still having it move with less amplified waves.

0 Kudos