Description

The licensee has shared the following workaround for modifying NiagaraMeshVertexFactory.ush.

struct FVertexFactoryInterpolantsVSToPS
{
	TANGENTTOWORLD_INTERPOLATOR_BLOCK
 
#if USE_PARTICLE_SUBUVS
	float4 SubUV0AndTexCoord0 : TEXCOORD1;
	float4 SubUV1AndLerp : TEXCOORD2;

	// add
	#if  NUM_TEX_COORD_INTERPOLATORS
		float4	TexCoords[( NUM_TEX_COORD_INTERPOLATORS+1)/2]	: TEXCOORD0;
	#endif
	//

 

 

Steps to Reproduce

Open the attached project NewNiagaraEmitter to see the problem.

-Enable raytracing.
-Set the Material's Blend Mode to Addtive or Translucent.
-Use both Particle SubUV and Texture Sample.
-Use Niagara Mesh Particles.

If these conditions are met, a compile error will occur.

Callstack

LogShaderCompilers: Warning: Failed to compile Material /Game/TestM.TestM for platform PCD3D_SM5, Default Material will be used in game.
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:926:42: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
return Interpolants.InterpolantsVSToPS.TexCoords[0].xy;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:945:77: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
Result.TexCoords[CoordinateIndex * 2] = Interpolants.InterpolantsVSToPS.TexCoords[CoordinateIndex].xy;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:946:81: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
Result.TexCoords[CoordinateIndex * 2 + 1] = Interpolants.InterpolantsVSToPS.TexCoords[CoordinateIndex].wz;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:949:65: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
Result.TexCoords[ 1 - 1] = Interpolants.InterpolantsVSToPS.TexCoords[ 1 / 2].xy;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:991:25: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
O.InterpolantsVSToPS.TexCoords[i] = a.InterpolantsVSToPS.TexCoords[i] * aInterp + b.InterpolantsVSToPS.TexCoords[i] * bInterp ;
~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:991:61: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
O.InterpolantsVSToPS.TexCoords[i] = a.InterpolantsVSToPS.TexCoords[i] * aInterp + b.InterpolantsVSToPS.TexCoords[i] * bInterp ;
~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: /Plugin/FX/Niagara/Private/NiagaraMeshVertexFactory.ush:991:107: error: no member named 'TexCoords' in 'FVertexFactoryInterpolantsVSToPS'
O.InterpolantsVSToPS.TexCoords[i] = a.InterpolantsVSToPS.TexCoords[i] * aInterp + b.InterpolantsVSToPS.TexCoords[i] * bInterp ;
~~~~~~~~~~~~~~~~~~~~ ^
LogShaderCompilers: Display: D3DCompileToDxil failed

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-131311 in the post.

0
Login to Vote

Fixed
ComponentUE - Rendering - Niagara
Affects Versions4.27
Target Fix5.0
CreatedOct 12, 2021
ResolvedOct 20, 2021
UpdatedOct 26, 2021