Jump to content

[SOLVED] compute shader


photo

Recommended Posts

As far as I know CUDA/OpenCL compute shaders are only used internally within the engine e.g. for bitonic/radix sort, skinned mesh calculations if supported by hardware.

 

I think there are no SDK samples on compute shaders usage yet although UNIGINE Material class supports compute shader definition

Link to comment

As far as I know CUDA/OpenCL compute shaders are only used internally within the engine e.g. for bitonic/radix sort, skinned mesh calculations if supported by hardware.

 

I think there are no SDK samples on compute shaders usage yet although UNIGINE Material class supports compute shader definition

there is class Shader in Unigine SDK in includes, i`l try use it with unigine dll

Link to comment

This will not work (Shader is just an internal base class) You have to define a new Material with compute shader reference definition and a separate shader definition file (something similar like this old example, but with a compute shader reference definition)

But as this is not straight forward in UNIGINE and more or less undocumented I think UNIGINE should provide a working sample.

Link to comment

Hello,

 

I think with the C++ API you can also run your compute shader directly with DX11 or OpenGL.

The Unigine::Texture class provides access to the underlying OpenGL texture Id or the DX11 Texture Interface respectively.

The directx device and the context can be retrieved from the Unigine::App class.

What I don't understand though is, how can I retrieve a Unigine::Texture from a material.

 

Some examples would be very nice

 

cheers

Link to comment

We don't provide access to material textures via C++ API. It's low priority for us now.

C++ API Shader interface has Direct3D and OpenGL compute shader support.

You can use this class for post-processing effects but you have to call Dispatch or glDispatchCompute methods manually.

This is Engine framework test compute test programs (full engine source code is required).

ComputeSamples.tar.gz

Link to comment
×
×
  • Create New...