Stingray Forum (Read Only)
Welcome to Autodesk’s Stingray Forums. Share your knowledge, ask questions, and explore popular Stingray topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Real-time Volumetric Clouds

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
ustaevb
3478 Views, 24 Replies

Real-time Volumetric Clouds

Here is some work showing real-time Volumetric clouds done in Stingray

 

https://www.youtube.com/watch?v=wHGzrdKylA4

 

Please feel free to visit the Blog for more details https://gamedev.autodesk.com/blogs/1/post/8809206359454882719

24 REPLIES 24
Message 2 of 25
Anonymous
in reply to: ustaevb

Wow, the clouds are looking great!

 

I tried to use the plugin in different projects with Stingray Version 1.5.863.0.

But it does not work for me, I always get an error with "test level" and "run project:

 

Test Engine / Lua: clouds-resources/clouds.lua:5: attempt to index global 'Renderer' (a nil value)

Lua Callstack
----------------------------------------

    [1] clouds-resources/clouds.lua:5: in function generate
    [2] clouds-resources/clouds.lua:27:in function <clouds-resources/clouds.lua:26>
    [3] [C]: in function load_level
    [4] core/appkit/lua/simple_project.lua:104: in function load_level
    [5] core/appkit/lua/simple_project.lua:194: in function init
    [6] [string "..."]:12: in main chunk 

Lua Locals
----------------------------------------

    [1] self = table: 0000000077C62968
    [2] world = [World], instances = table: 0000000077C62A50
    [4] resource_name = __level_editor_test, level_name = , world = [World]
    [5] config = table: 0000000077C5FF68, world = [World], world_wrapper = table: 0000000077C61608, camera_unit = [Unit 'core/appkit/units/camera/camera'], standalone_init_level_name = content/levels/vr_buero, level_resource_name = __level_editor_test
    [6] orig_update = [function]

Does the plugin work with the current version of stingray?

 

Message 3 of 25
greniej
in reply to: Anonymous

Hi Sebastian,

 

A few poeple have reported this issue but I haven't been able to replicate just yet. In the mean time I have created a small video showing how to load the plugin that can be found here:

https://www.youtube.com/watch?v=lZ1i3b5fa5U

 

Let me know if this helps. I'll debug on my side.

Thanks!

Jp

Message 4 of 25
Anonymous
in reply to: greniej

First I tried to follow the readme instructions, but I got the error mentioned earlier.

 

Quick video showing this in action: https://www.youtube.com/watch?v=lZ1i3b5fa5U

1.    Copy clouds-resources directory into the root of your Stingray project folder
2.    Make sure the settings.ini has a line pointing out the render_config_extension file like this: render_config_extensions = [ "clouds-resources/clouds" ]
3.    Drag a clouds entity in the scene

Then I watched your instruction video and I loaded the plugin with the plugin manager in stingray. This step is missing in the readme!

 

Now the clouds work in the editor viewport, but I still get the error message when I use "test level".

 

I wonder what's causing the error on some systems. I have two machines, one Windows 7 and the other is Windows 8.1, both 64bit.

I also tried using the basic project template.

Message 5 of 25
Anonymous
in reply to: greniej

hey man,
looking great. However I am getting this error 

Data / Compiler: Error compiling clouds-resources/clouds.shader_source

Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: cs_main
Instruction s

[...]

on set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'


Failed compiling shader library: (97): 

Entry point: vs_main
Instruction set: vs_4_0
Error Message:
clouds-resources/clouds.shader_source(98,14-53): error X3017: cannot implicitly convert from 'float4' to 'float4x4'

 

and 

Could not find the shader_library_group named `clouds-resources/clouds`

Assertion failed `_resource_manager.can_get(shader_library_group, name)` at `D:\BuildAgent\work\77aa4c8074a56d3f\git\runtime\application\rendering\shader_library.cpp:177`

Looks like something is missing. However

 

Any idea what might be the cause of this?

Message 6 of 25
PRuveron
in reply to: Anonymous

Same problem for me on Stingray 1.5

Philippe

 

Message 7 of 25
Anonymous
in reply to: PRuveron

Try to use the release version from the link https://github.com/greje656/clouds/releases

 

Here is the git update that might have caused your issue https://github.com/greje656/clouds/commit/14e354203bcae9fe9b4c16eed5ebfaa9402d35bb

and the comment for it is "First pass at changing all matrix access to the stereo instancing camera indices"

 

Message 8 of 25
Anonymous
in reply to: Anonymous

Thank you! I can drag and drop and clouds into the scene now and they look beautiful.however. I am getting this error when trying to start the game 

Lua: clouds-resources/clouds.lua:5: attempt to index global 'Renderer' (a nil value)

 Where is this Renderer located the script is trying to access?

Message 9 of 25
PRuveron
in reply to: Anonymous

Bonjour,

I just try this version on an basic template.

It's a lot better => It works in the editor.

 

But, I've an error at the launch of test level.

It's exactly the same as OzgurCelet in post on Github.

 

https://github.com/greje656/clouds/issues/4

 

No problem if you haven't time to look at it. I'll wait a next version if necessary.

Philippe

 

Message 10 of 25
Anonymous
in reply to: PRuveron

From what I can tell, it looks like the "render_config_extension" setup works only for the Editor and it fails on the Test Level or the Game.  The way that I got around it is going back to the original setup of changing the "renderer.render_config" file. 

I am attaching my running version of it.  You will need to replace (make a backup first just in case) the one in "core/stingray_renderer/" folder. If you declare a separate "renderer.package" and "renderer.render_config", the editor might start throwing errors about not being able to find a whole bunch of shaders and going out of whack. 

If you are replacing the "renderer.render_config" file, remember to comment out the "render_config_extensions" portion that deals with the clouds in the "settings.ini" file.

 

Also, if you want to use the latest code from the git master, overwrite the "clouds.shader_source" file with the one attached and change in the ".component" files under "metadata" the "component" value from "render_data" to "data"(attached just in case). 

 

Also forgot to mention, that you might need to change in the "clouds.lua" file the referencing of "Renderer" to "stingray.Renderer"

 

function Clouds:generate()
	cloud_resource3 = stingray.Renderer.resource("clouds_result_texture3")
	cloud_resource1 = stingray.Renderer.resource("clouds_result_texture1")
	cloud_resource2 = stingray.Renderer.resource("clouds_result_texture2")
	

	resource_maping1 = {}
	resource_maping2 = {}
	resource_maping3 = {}

	resource_maping1["input"] = cloud_resource1
	resource_maping2["input"] = cloud_resource2
	resource_maping3["input"] = cloud_resource3

	resource_maping1["output"] = cloud_resource1
	resource_maping2["output"] = cloud_resource2
	resource_maping3["output"] = cloud_resource3

	stingray.Renderer.run_resource_generator("cloud_generator_texture1", resource_maping1)
	stingray.Renderer.run_resource_generator("cloud_generator_texture2", resource_maping2)
	stingray.Renderer.run_resource_generator("cloud_generator_texture3", resource_maping3)
end

 

Message 11 of 25
PRuveron
in reply to: Anonymous

Well, everything work now 🙂

 

I can go make some tests.

 

Thanks a lot Elvin.

Philippe

 

Message 12 of 25
Anonymous
in reply to: Anonymous

Thank you very much!!!! works like a charm now 🙂

Message 13 of 25
greniej
in reply to: Anonymous

Thanks for this report. A lot of this will be ironed out in 1.6. Thanks for pointing it out.

Cheers!

Message 14 of 25
greniej
in reply to: greniej

Regarding:

Lua: clouds-resources/clouds.lua:5: attempt to index global 'Renderer' (a nil value)

 

I've just fixed it in the clouds repro:

https://github.com/greje656/clouds/commit/1977b807260518f490fd8e1dbca03b353fcf9922

 

Regarding:
Editor / General: basic_project: Resource set does not contain the resource named `clouds_result_texture1`

To fix this you need to edit settings.ini with:

autoload = true

 

Note I'm not 100% if this is the proper solution yet, but it works. Will follow up on this.

 

Cheers!

Message 15 of 25
PRuveron
in reply to: greniej

Bonjour,

I want to use clouds in 1.6 with the new possibility of download the plugin from the plugin manager.

 

Stingray download well the plug and installation seems ok.

 

In shading environment, we now can add the clouds directly (click en '+' and choose 'Cloud' or 'Cloud Advance')

No problem to add, but nothing change on 3d view.

 

When I click to play, i've this errors :

Test Engine / ResourcePackage: Failed loading shading_environment_mapping named `clouds-resources/moon`
Test Engine / ResourcePackage: Failed loading shading_environment_mapping named `clouds-resources/cirrus`
Test Engine / ResourcePackage: Failed loading shading_environment_mapping named `clouds-resources/weather_storm`

 

I try to add render_config_extensions like before, but same problem.

Drag and drop of the hidden Cloud entity from clouds_resource folder => error.

 

Any idea ?

Philippe

 

Message 16 of 25
__ben__
in reply to: PRuveron

Did you remember to add the line:


render_config_extensions = [ "clouds-resources/clouds" ]

 

To your project's settings.ini to link in the resources provided by the clouds plugin?

 

 

Message 17 of 25
PRuveron
in reply to: __ben__

Yes

Have you success with 1.6 and clouds ?

Philippe

 

Message 18 of 25
Anonymous
in reply to: PRuveron

same here, no success in 1.6 😞

Message 19 of 25
Anonymous
in reply to: PRuveron

Philippe,

 

 

You would need all four elements of the Clouds entity added to the Shading Environment for it to work including the Script component pointed to "clouds-resources/clouds"

I could not find the Clouds Atmosphere component in the Shading environment so I would suggest going with the the "clouds" entity that the plugin comes with.

The plugin works for me without any changes for the 1.6 in the Editor.

For the Game Play, you still need to add (uncomment) the line below in the "settings.ini" file for it to work.

"autoload = true"

 

Message 20 of 25
Anonymous
in reply to: Anonymous

Or you can go Create->Clouds. Just found it. Smiley Surprised

 

http://stingray-iotd.tumblr.com/image/152468336507

 

 

 

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report