# Need help with c++

**URL:** <https://forums.unrealengine.com/t/need-help-with-c/130143>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [August 21, 2019, 1:53pm UTC](https://forums.unrealengine.com/t/need-help-with-c/130143 "2019-08-21T13:53:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2722767](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2722767](https://forums.unrealengine.com/u/anonymous_user_b2722767)\
**Post date:** [August 21, 2019, 1:53pm UTC](https://forums.unrealengine.com/t/need-help-with-c/130143/1 "2019-08-21T13:53:35Z")

</div>

Who can help me recreate this [Shader - Shadertoy BETA](https://www.shadertoy.com/view/3d23RG) in the Unreal Engine 4 (Only fog part)

---

<div class="post-metadata">

**Author:** ![Antidamage](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/antidamage/32/918692_2.png) [@Antidamage](https://forums.unrealengine.com/u/Antidamage)\
**Post date:** [August 22, 2019, 12:33am UTC](https://forums.unrealengine.com/t/need-help-with-c/130143/2 "2019-08-22T00:33:13Z")

</div>

This belongs in the material section.

As for recreating it, you can do it step-by-step using material nodes. A couple of OpenGL functions like mix() should be replaced with Lerp (and fract() with Frac) but otherwise it’s pretty straightforward.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2722767](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2722767](https://forums.unrealengine.com/u/anonymous_user_b2722767)\
**Post date:** [August 22, 2019, 8:10pm UTC](https://forums.unrealengine.com/t/need-help-with-c/130143/3 "2019-08-22T20:10:20Z")

</div>

> [@Antidamage](#):
>
> This belongs in the material section.
> 
> As for recreating it, you can do it step-by-step using material nodes. A couple of OpenGL functions like mix() should be replaced with Lerp (and fract() with Frac) but otherwise it’s pretty straightforward.

i cant recreate this

vec2 uv = (fragCoord - iResolution.xy \* 0.5) / iResolution.y; //Screen

```
vec3 from = vec3(0, 0, -5.0); //CameraPosition
vec3 dir = normalize(vec3(uv*0.5, 1.0)); //RayDirection

```

how to make this working in ue4?
