Hello,
I need to use this kind of texture, I can create one but then how I can fill it with data? for example all black elements?
There is a good written documentation or simple example about this type? I’m using C++
Ok, I found out that I should use this macro in order to be sure the code will be executed in the rendering thread:
ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER
But, at this point, what parameter should I pass to these macro? I see 4 parameters are needed plus the code.
Actor’s tick function happens on game thread so calling those functions there is not allowed and that is the reason for the crash.
To send something to the rendering thread you must enqueue it.
This is done as follows:
TypeName - Arbitrary name of the render command
ParamType1 - The type of the parameter
ParamName1 - Name of the parameter inside the render command
ParamValue1 - the value of the parameter passed from the outside
Code- The code that will be executed on the render thread
[POST EDITED]
After some trial and error the code above seems working and It was a problem of mine. I didn’t understand what it was… I’m quite confused but now It does not crash.
/*if (ComputeShading) {
ComputeShading->ExecuteComputeShader(TotalElapsedTime);
InputTexture = ComputeShading->GetTexture(); //This is the output texture from the compute shader that we will pass to the pixel shader.
}*/
it crashes!
I put a screenshot so you can see in which line it crashes