Im using the rendergraph api to render sprites with a material that should give them a color (in the case of the image green), but the result is black.
The target texture is RG32, the material is Unlit and im in unity 6 URP.
This is my code to render:
private void ExecutePass(PassData data, RasterGraphContext renderGraphContext) {
renderGraphContext.cmd.ClearRenderTarget(true, true, Color.white);
foreach (var spriteRenderer in data.mirrorSprites) {
if (!spriteRenderer || !spriteRenderer.sharedMaterial || !spriteRenderer.enabled) continue;
renderGraphContext.cmd.DrawRenderer(spriteRenderer, spriteRenderer.sharedMaterial);
}
}
and the result is the attached image, where the green triangle is the one being rendered by unity and the black one is being rendered on the target texture, both use the same material.