Help needed: Can not link GetSceneTextureParameters function for RTX shader plugin

I’ve been trying to use RTX to get world position of each pixel in the rendered image, the code is based on a plugin sample from FluffyBunnyO.
I’ve encountered some accuracy issues because in the plugin sample the shader does not use the depth texture in order to calculate the ray origin and there for the ray origin is not accurate.
I’ve tried to pass on to the shader SceneDepthTexture by copying code from unreal engine but I’ve got a linkage error for function GetSceneTextureParameters.
I’ve checked the signatures of the function in Renderer.dll and I could not find any reason for this error.

Plugin code is here: Plugin Code
FluffyBunnyO tutorial is here: How to Create a Custom Ray Tracing Shader as a Plugin

Thanks.
Tamir.

Link Error :

1>Module.CustomShaders.cpp.obj : error LNK2019: unresolved external symbol "class FSceneTextureParameters __cdecl **GetSceneTextureParameters**(class 
FRDGBuilder &,class FViewInfo const &)" (?GetSceneTextureParameters@@YA?AVFSceneTextureParameters@@AEAVFRDGBuilder@@AEBVFViewInfo@@@Z) referenced in 
function "private: void __cdecl FRayGenTest::Execute_RenderThread(class FPostOpaqueRenderParameters &)" 
(?Execute_RenderThread@FRayGenTest@@AEAAXAEAVFPostOpaqueRenderParameters@@@Z)
2 Likes

did you ever find a fix for this?

Copy and paste the GetSceneTextureParameters function at the bottom of the file.

I’m using ViewExtension, but the basics should be the same as the tutorial above.

#include "SceneTextureParameters.h"
...

void FMyViewExtension::PrePostProcessPass_RenderThread(FRDGBuilder& GraphBuilder, const FSceneView& InView,
	const FPostProcessingInputs& Inputs)
{
...
			FSceneTextures SceneTextures = static_cast<const FViewInfo&>(InView).GetSceneTextures();
			PassParameters->SceneTextures = GetSceneTextureParameters(GraphBuilder, SceneTextures);
...


//Add this function to the bottom of the file:
// Engine/Source/Runtime/Renderer/Private/SceneTextureParameters.cpp:37
FSceneTextureParameters GetSceneTextureParameters(FRDGBuilder& GraphBuilder, const FSceneTextures& SceneTextures)
{
	const auto& SystemTextures = FRDGSystemTextures::Get(GraphBuilder);

	FSceneTextureParameters Parameters;

	// Should always have a depth buffer around allocated, since early z-pass is first.
	Parameters.SceneDepthTexture = SceneTextures.Depth.Resolve;
	Parameters.SceneStencilTexture = GraphBuilder.CreateSRV(FRDGTextureSRVDesc::CreateWithPixelFormat(Parameters.SceneDepthTexture, PF_X24_G8));

	// Registers all the scene texture from the scene context. No fallback is provided to catch mistake at shader parameter validation time
	// when a pass is trying to access a resource before any other pass actually created it.
	Parameters.GBufferVelocityTexture = GetIfProduced(SceneTextures.Velocity);
	Parameters.GBufferATexture = GetIfProduced(SceneTextures.GBufferA);
	Parameters.GBufferBTexture = GetIfProduced(SceneTextures.GBufferB);
	Parameters.GBufferCTexture = GetIfProduced(SceneTextures.GBufferC);
	Parameters.GBufferDTexture = GetIfProduced(SceneTextures.GBufferD);
	Parameters.GBufferETexture = GetIfProduced(SceneTextures.GBufferE);
	Parameters.GBufferFTexture = GetIfProduced(SceneTextures.GBufferF, SystemTextures.MidGrey);

	return Parameters;
}

Add Renderer module and IncludePath to build.cs

		PrivateIncludePaths.AddRange(
			new string[] {
				Path.Combine(GetModuleDirectory("Renderer"), "Internal"), 
				Path.Combine(GetModuleDirectory("Renderer"), "Private"),
				Path.Combine(GetModuleDirectory("RenderCore"), "Public")
			}
		);
			
		
		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"RHI",
				"RenderCore",
				"Renderer",
				"Projects",
				"RenderTrace"
			}
		);