How can I represent water in CityEngine?

1695
4
01-19-2018 03:10 AM
PedroOliveira1
New Contributor II
Is it possible to represent water in motion, a river for example?

Thank you 
Pedro Oliveira 
4 Replies
Luiz_AmadeuCoutinho
Occasional Contributor III

Hi Pedro

Yes you can. There´s two options:

1. Choose one polygon and add to the end of the name  " __water  " : example  myriver__water

A sample here http://bit.ly/2EWMpSR 

2. Option two : Use the rule WaterMaterial.cga available on http://www.arcgis.com/home/item.html?id=067950a3a1f44129a10b3a458802e450 

PedroOliveira1
New Contributor II

Thank you, it worked.

greetings

RyanKocourek
New Contributor II

Hi there,

Could you allow us access to download the cga file? It says that we don't have permission to access.

Thank you sir!

Luiz_AmadeuCoutinho
Occasional Contributor III

/**
* File: WaterMaterial.cga
* Created: 30 May 2013 19:24:39 GMT
* Author: Craig
*/

version "2013.1"

// A simple water texture rule with 5 different types - different colors, wave heights & speeds

@Order(1) @Range("River","Stream","Pond","Lake","Ocean")
attr Water_Type = "River"

@Range(0, 1.0)
@Order(2)
attr r = .44
@Range(0, 1.0)
@Order(3)
attr g = .55
@Range(0, 1.0)
@Order(4)
attr b = .44

@StartRule
Water -->
// __waterparams_scale_speed
case Water_Type == "River" :
set(material.name, "river__water__waterparams_5_10")
color(.44,.55,.44)
case Water_Type == "Stream" :
set(material.name, "river__water__waterparams_5_30")
color(.44,.55,.44)
case Water_Type == "Pond" :
set(material.name, "river__water__waterparams_1_3")
color(.2,.4,.45)
case Water_Type == "Lake" :
set(material.name, "river__water__waterparams_4_8")
color(.2,.4,.45)
case Water_Type == "Ocean" :
set(material.name, "river__water__waterparams_15_20")
color(.2,.4,.45)
else: X.

0 Kudos