www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Shadertoy in Dcompute?

reply Bert <Bert gmail.com> writes:
How hard would it be to do something like Shadertoy in Dcompute 
and would it be any faster?

I don't like the basics of Shadertoy, lots of nonsense to do 
basic stuff. E.g., to work with complex numbers one must 
essentially do everything manually.

Would there be any benefit using Dcompute(last time I tried it I 
couldn't get it to work).
Aug 21 2019
parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Thursday, 22 August 2019 at 00:57:26 UTC, Bert wrote:
 How hard would it be to do something like Shadertoy in Dcompute 
 and would it be any faster?

 I don't like the basics of Shadertoy, lots of nonsense to do 
 basic stuff. E.g., to work with complex numbers one must 
 essentially do everything manually.

 Would there be any benefit using Dcompute(last time I tried it 
 I couldn't get it to work).
DCompute is primarily for compute at the moment, and not graphics. It targets OpenCL and CUDA, not OpenGL/WebGL/Vulkan/DirectX. Thats not to say that you can't use it for computational graphics but you wouldn't be utilising the specialised hardware for the rendering pipeline, so it would probably be slower. If you want to have a crack at it, I'd take a look at how to do graphics with OpenCL or CUDA and adapt what you can. I haven't tested OpenCL/OpenGL interop at all (with or without DCompute) but it is a thing.
Aug 21 2019