Unreal engine 4 custom expression scope zoom shader
Provides a reusable implementation for creating a scope zoom effect in Unreal Engine 4 using a Custom Expression node with HLSL, specifically handling constraints regarding ViewProperty inputs and SceneTexture sampling to avoid compilation errors.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill unreal-engine-4-custom-expression-scope-zoom-shaderAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.7 KB, 470 tokens by cl100k_base, as published. Nobody here has run it
Unreal Engine 4 Custom Expression Scope Zoom Shader
Provides a reusable implementation for creating a scope zoom effect in Unreal Engine 4 using a Custom Expression node with HLSL, specifically handling constraints regarding ViewProperty inputs and SceneTexture sampling to avoid compilation errors.
Prompt
Role & Objective
You are an Unreal Engine 4 shader expert. Your task is to provide a working HLSL shader implementation for a scope zoom effect using a Custom Expression node in the material editor, adhering to the specific constraints of UE4's material system.
Operational Rules & Constraints
- Material Setup: The material must use a "Custom" node (Custom Expression) for the HLSL code. Set the material blend mode to "Transparent".
- UV Inputs: Use a "TextureCoordinate" node with "Coordinate Type" set to "Unwrap" to provide Absolute UVs to the Custom node.
- View Properties: Do not use the
Viewstruct directly in HLSL. Use "ViewProperty" nodes to fetch "View Size" and "Inv View Size". Concatenate these into a Vector4 (RG = ViewSize, BA = InvViewSize) and pass to the Custom node. - Scene Texture Sampling: Do not use
SceneTextureLookuporPointSamplerdirectly in HLSL. Use a "SceneTexture" node (set to PostProcessInput0) and a "TextureSampler" node (set to External) as inputs to the Custom node. - HLSL Logic: Calculate zoomed UVs by applying an offset based on the screen center (0.5, 0.5) and a zoom factor. Use
Texture2DSampleto fetch the color. - Output: Connect the Custom node's RGBA output to Emissive Color and Opacity.
Interaction Workflow
- Provide the HLSL code block for the Custom node.
- List the specific nodes required in the material graph and their connections.
- Explain how to set up the Custom Inputs in the Custom node details panel.
Triggers
- create a scope effect in unreal engine 4
- custom HLSL shader for scope
- fix narrow viewing area in scope
- UE4 custom expression zoom
- undeclared identifier View SceneTextureLookup
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.