# UE5.4  I am unable to draw colors to the scene color

**URL:** <https://forums.unrealengine.com/t/ue5-4-i-am-unable-to-draw-colors-to-the-scene-color/2127105>\
**Category:** Rendering\
**Tags:** unreal-engine, editor, Rendering\
**Created:** [November 16, 2024, 5:34am UTC](https://forums.unrealengine.com/t/ue5-4-i-am-unable-to-draw-colors-to-the-scene-color/2127105 "2024-11-16T05:34:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![I-am-waste](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@I-am-waste](https://forums.unrealengine.com/u/I-am-waste)\
**Post date:** [November 16, 2024, 5:34am UTC](https://forums.unrealengine.com/t/ue5-4-i-am-unable-to-draw-colors-to-the-scene-color/2127105/1 "2024-11-16T05:34:42Z")

</div>

Here is the code I added  
Pass.cpp

```auto
const bool bShouldRenderView = View.ShouldRenderView();
		if (bShouldRenderView)
		{
			View.BeginRenderView();

			auto* PassParameters = GraphBuilder.AllocParameters<FLightMyParameters>();
			PassParameters->View = View.GetShaderParameters();
			PassParameters->LightMyData = CreateLightMyPassUniformBuffer(GraphBuilder, SceneTextures);
			PassParameters->RenderTargets.DepthStencil = FDepthStencilBinding(SceneTextures.Depth.Target, ERenderTargetLoadAction::ELoad, ERenderTargetLoadAction::ELoad,
				FExclusiveDepthStencil::DepthWrite_StencilNop);

			PassParameters->RenderTargets[0] = FRenderTargetBinding(SceneTextures.Color.Target, ERenderTargetLoadAction::ELoad);
			PassParameters->RenderTargets[1] = FRenderTargetBinding(SceneTextures.MyTextTexture, ERenderTargetLoadAction::EClear);

			View.ParallelMeshDrawCommandPasses[EMeshPass::LightMy].BuildRenderingCommands(GraphBuilder, Scene->GPUScene, PassParameters->InstanceCullingDrawParams);

			GraphBuilder.AddPass(
				RDG_EVENT_NAME("LightMy"),
				PassParameters,
				ERDGPassFlags::Raster | ERDGPassFlags::SkipRenderPass,
				[this, &View, PassParameters](const FRDGPass* InPass, FRHICommandListImmediate& RHICmdList)
			{
				FRDGParallelCommandListSet ParallelCommandListSet(InPass, RHICmdList, GET_STATID(STAT_CLP_LightMy), View, FParallelCommandListBindings(PassParameters));
				View.ParallelMeshDrawCommandPasses[EMeshPass::LightMy].DispatchDraw(&ParallelCommandListSet, RHICmdList, &PassParameters->InstanceCullingDrawParams);
			});
		}

```

Pass.usf

```auto
void MainPS(
    FToonMeshPassVSToPS Input,
    out float4 OutColor : SV_Target0,
	out float4 OutColor2 : SV_Target1)
{
	const float2 SceneBufferUV = SvPositionToBufferUV(Input.SvPosition);
    // FMaterialPixelParameters MaterialParameters = GetMaterialPixelParameters(Input.FactoryInterpolants, Input.SvPosition);

	// float2 NDC = MaterialParameters.ScreenPosition.xy / MaterialParameters.ScreenPosition.w;
	// float2 ScreenUV = NDC * ResolvedView.ScreenPositionScaleBias.xy + ResolvedView.ScreenPositionScaleBias.wz;

    float clampShadow = LightMyData.ToonShadowTexture.SampleLevel(LightMyData.ToonShadowTextureSampler, SceneBufferUV, 0).r;
    float selfShadow = LightMyData.ToonShadowTexture.SampleLevel(LightMyData.ToonShadowTextureSampler, SceneBufferUV, 0).g;
    float highLight = LightMyData.ToonShadowTexture.SampleLevel(LightMyData.ToonShadowTextureSampler, SceneBufferUV, 0).b;

	OutColor = float4(1,0,0,1);
	OutColor2 = selfShadow.xxxx;
    // OutColor = float4(1.0f,0.0f,0.0f,1.0f);
}

```

This is the information I captured using RenderDoc

 ![7a79cb2f66b4425c98642b3d68ec3273](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/a/37a5138387eb6da39c849933badaee684dddafaf.png)
