Jump to content

getProceduralTextureImage (CPU->GPU->CPU) sample


photo

Recommended Posts

hi, i need detailed sample Procedural Texturing in Unigine. there is no in samples.

 

i need acquire Unigine::ImagePtr from some pass of fragment shader from GPU to application (CPU).

Link to comment
  • 3 weeks later...
Hi Sergey!

 

In terms of the Rendering Sequence, the render pass is the rendered geometry with the specific shader applied. Different passes (e.g. shadows, refraction, auxiliary) can be applied to the same geometry. You can't find out what exactly was written to the specific pass except for the auxiliary pass: it is used to render geometry with the specific shader to the separate Render Texture that will be available for post-processing.

 

As to procedural textures, they are always calculated before post-processing. Alternatively, their calculation can be forced beyond the Rendering sequence by the following API method:



void engine.render.renderProcedurals (int materials = [])


After executing this method, you can get the texture obtained in shader by the following Material class method:



int getProceduralTextureImage (int id, Image image)


This way you would get the procedurally generated texture (stored on the CPU).

 

Kind regards,

Leonid.

Link to comment
×
×
  • Create New...