sergey.pozhidaev Posted October 1, 2013 Share Posted October 1, 2013 hi, show me some example compute shader using on unigine Link to comment
ulf.schroeter Posted October 1, 2013 Share Posted October 1, 2013 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
sergey.pozhidaev Posted October 2, 2013 Author Share Posted October 2, 2013 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
ulf.schroeter Posted October 2, 2013 Share Posted October 2, 2013 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
helmut.bressler Posted October 2, 2013 Share Posted October 2, 2013 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
frustum Posted October 7, 2013 Share Posted October 7, 2013 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
Recommended Posts