#You re adding these commands into a
1 messages · Page 1 of 1 (latest)
is it possible to compress two operations into a single command ?
like if i would SetTexture twice / set two textures on the paint material
To what end?
and use the results to draw into two different render textures
or would it be necessary to make another maskRenderTexture
im trying to sort the RGBA channels
in a way
so i got two textures , and each channel corresponds to the other textures channel
for example tex1 Red and tex2 Red will store the same "layer" information
the paint shader will have two textures as input
and apply sorting based on new input values
the confusing part is how i extract the end result
like ... the method DrawRender will it override all the pixels ?
and the Blit method , does it overrides all the pixels as well , or will it have an additive effect
ehhh... ill just create two shaders instead
was hoping to optimize this with one operation
You can render to multiple render targets in one draw call, if the render textures are the same resolution.
how ?
https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetRenderTarget.html has overloads that take RenderTargetIdentifier[] colors to set multiple color render targets (there can still only be one depth target).
And then in the fragment shader, you use SV_Target0, SV_Target1, etc... to output multiple colors in one pass:
https://github.com/keijiro/UnityMrtTest/blob/master/Assets/MrtTest.shader
wow
based keijiro
ahh so he creates two passes
interesting
output result is still one texture , right ?
my current target is vulkan , seems i can't use that since SHADER_API_GLES
The second pass is there just as a test to combine the two textures. If you don't need them combined, you don't need a second pass.
The first pass renders to both textures.
The result is two textures.