Sea/Water rendering


#1

I’ve seen here Seascape Skybox Hang Ten in HiFi that ocean/sea did work some years ago in HF.
It is not clear to me if this is still true today and how I can have a domain with water.
Is there a page describing this? Is this too heavy to produce?
Also, do object being under water have a special rendering?
Some of my friends teachers did create some simple marine life blender scene and we were curious if we can render it on HighFidelity.


#2

The ocean skybox, which should still works was more of an external shader effect than an actual ocean. So it was more of a “background environment” than something you actually are in, thus the name “skybox”. Regardless of height or place it would always be the same, unless the shader was specially built.

If you want to build a scene with permanence then you have to have a physical ocean instead.

Now regarding the underwater effect, you have fog which you can control to different thickness. with enough tweaking you can create a scene that feels like it is under water.


#3

I was asking for documentation for the shaders but found a very complete one here: https://www.youtube.com/watch?v=tfnl-6pypl4
so I will experiment with that.
I’m understanding that there are plenty of such features in HiFi. Where is this particular feature documented in HiFi documentation? I was not able to find it, my dumb :frowning:


#4

Unfortunately, the documentation is lacking regarding shaders, however most uptodate documentation can be found at https://docs.highfidelity.com/

Note that video is from 2015, and since there there has been some changes to the shaders. The basics are presented in the video, so it is still a good watch, but Since then, they had upgraded the rendering engine to use PBR shading, causing the custom shader to have more inputs

float getProceduralColors( inout vec3 diffuse, inout vec3 specular, inout float shininess )

Which returns a float that defines a emit value from 0-1.

Here is an example shader I made last year that is fully commented.

Shader:
http://mpassets.highfidelity.com/1487ff47-1c2b-438b-826f-734afed6a297-v1/SpriteSheetNew.fs

Entity, which you can rez to see userData:


#5

Thanks a lot, meanwhile I was able to do this very simple example https://youtu.be/GAQV2VAkSR8 inspired from the original video and with some adjustments I had to invent on the fly to make it compile with current hf, but your documentation is really useful.


#6

@Menithal i just undesrstood that the ocean sea water was done with a different shader than that used by spritesheet, apparently involving something about mainImage and getskyboxcolor. These scripts are no more functional with latest modifications since 2015. Is there some further information you know where I can understand how to make script like this one work? Maybe this is just the same as Procedural Colors but to be put in a zone userdata? Again I couldnt find any information on the highfidelity documentation … So still no water can be produced at least by me … I removed the solved tick since the original question is still unresolved…


#7

You sure it’s the script and not the URL?
Protip: metaversecafes went ‘out of business’ years ago. That domain expired last week. Try the same URL but swap out ‘metaversestudios’ instead.

update
http://metaversestudios.com/HighFidelity/QueenCity/shaders/oceanSkybox_v4.fs
and if you load this JSON it will ‘automagically’ do it for you…
http://metaversestudios.com/HighFidelity/QueenCity/shaders/rezSkybox.json


Also you can see this: Adapted Cloud shaders


#8

the two links are apparently still broken

wget http://metaversestudios.com/HighFidelity/QueenCity/shaders/rezSkybox.json
–2018-06-15 23:38:24-- http://metaversestudios.com/HighFidelity/QueenCity/shaders/rezSkybox.json
Resolving metaversestudios.com (metaversestudios.com)… 66.96.162.136
Connecting to metaversestudios.com (metaversestudios.com)|66.96.162.136|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2018-06-15 23:38:24 ERROR 404: Not Found.

do you have some working urls?


#9

My mistake. Drop the word ‘shaders’ from the url.

http://metaversestudios.com/HighFidelity/QueenCity/rezSkybox.json

{
  "Entities": [
    {
      "backgroundMode": "skybox",      
      "dimensions": {
        "x": 30000,
        "y": 30000,
        "z": 30000
      },            
      "name": "Ocean Skybox",
      "rotation": {
        "w": 1,
        "x": -1.52587890625e-05,
        "y": -1.52587890625e-05,
        "z": -1.52587890625e-05
      },
      "shapeType": "box",
      "skybox": {
        "url": "https://hifi-public.s3.amazonaws.com/images/SkyboxTextures/CloudyDay1.jpg"
      },
      "type": "Zone",
      "userData": "{\n    \"ProceduralEntity\": {\n        \"version\":2,\n        \"shaderUrl\": \"http://metaversestudios.com/HighFidelity/QueenCity/oceanSkybox_v4.fs\",\n        \"channels\":[\n            \"https://hifi-public.s3.amazonaws.com/austin/assets/images/skybox/starmap_8k.jpg\",\n            \"https://hifi-public.s3.amazonaws.com/austin/assets/images/skybox/celestial_grid.jpg\",\n            \"https://hifi-public.s3.amazonaws.com/austin/assets/images/skybox/constellation_figures.jpg\",\n            \"https://hifi-public.s3.amazonaws.com/austin/assets/images/skybox/constellation_boundaries.jpg\"\n        ],\n        \"uniforms\": {\n            \"rotationSpeed\":0.01,\n            \"uDayColor\": [0.9, 0.7, 0.7 ],\n            \"constellationLevel\": 0.03,\n            \"constellationBoundaryLevel\": 0.00,\n            \"gridLevel\": 0.01\n        }\n    }\n}"
    }
  ],
  "Version": 56
}

You will need to do the following:

  1. Save the file
  2. In your domain, use the import feature of the create tool and point to the newly downloaded .json file

Sorry for the confusion.

Good luck.


#10

thanks @AlphaVersionD (and all the others who answered my question) :slight_smile:
I tested it and it works… https://youtu.be/-XPh12vm5SM