# Accessing View struct from custom .usf shader causes undeclared identifier error

**URL:** <https://forums.unrealengine.com/t/accessing-view-struct-from-custom-usf-shader-causes-undeclared-identifier-error/2693128>\
**Category:** Rendering\
**Tags:** unreal-engine, Shaders, shader, question\
**Created:** [January 18, 2026, 3:38pm UTC](https://forums.unrealengine.com/t/accessing-view-struct-from-custom-usf-shader-causes-undeclared-identifier-error/2693128 "2026-01-18T15:38:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![X-perto](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@X-perto](https://forums.unrealengine.com/u/X-perto)\
**Post date:** [January 18, 2026, 3:38pm UTC](https://forums.unrealengine.com/t/accessing-view-struct-from-custom-usf-shader-causes-undeclared-identifier-error/2693128/1 "2026-01-18T15:38:10Z")

</div>

Hi everyone,

I’m writing a custom shader in a `.usf` file and I’m trying to access the `View` uniform buffer (e.g. `View.ViewProjectionMatrix`, etc.). However, the shader compiler errors out with:

```auto
error: use of undeclared identifier 'View'; did you mean 'new'?

```

On the C++ side, my shader derives from `FGlobalShader`, and I’ve added the following parameter:

```auto
SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View)

```

The shader compiles fine on the C++ side, but inside the `.usf` file the `View` symbol is still not defined.

I’ve also tried including common headers like:

```auto
#include "/Engine/Private/Common.ush"
#include "/Engine/Private/SceneTexturesCommon.ush"

```

but the issue persists.

What is the correct way to expose and access the `View` uniform buffer inside a custom `.usf` shader?  
Am I missing a required include, binding step, or macro on the shader side?

Any guidance or minimal working example would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![WildFire98](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WildFire98](https://forums.unrealengine.com/u/WildFire98)\
**Post date:** [January 22, 2026, 9:39am UTC](https://forums.unrealengine.com/t/accessing-view-struct-from-custom-usf-shader-causes-undeclared-identifier-error/2693128/2 "2026-01-22T09:39:03Z")

</div>

I have encountered same issuse. There is a temproal fix. For example, use View\_ViewRectMin.xy rather than View.ViewRectMin.xy

---

<div class="post-metadata">

**Author:** ![X-perto](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@X-perto](https://forums.unrealengine.com/u/X-perto)\
**Post date:** [January 22, 2026, 12:15pm UTC](https://forums.unrealengine.com/t/accessing-view-struct-from-custom-usf-shader-causes-undeclared-identifier-error/2693128/3 "2026-01-22T12:15:54Z")

</div>

Thank you! I’ll have to try that out.

Also good to know I’m not the only one experiencing this.

---

<div class="post-metadata">

**Author:** ![WildFire98](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WildFire98](https://forums.unrealengine.com/u/WildFire98)\
**Post date:** [January 23, 2026, 2:07am UTC](https://forums.unrealengine.com/t/accessing-view-struct-from-custom-usf-shader-causes-undeclared-identifier-error/2693128/4 "2026-01-23T02:07:47Z")

</div>

Also, this issue might caused by using parameters which name has changed. Such as View.PreViewTranslation now become two seperated parameters, View.PreViewTranslationHigh and View.PreViewTranslationLow
