# Spherical World Material - Where to do transformation on rendering pipeline?

**URL:** <https://forums.unrealengine.com/t/spherical-world-material-where-to-do-transformation-on-rendering-pipeline/16947>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [December 11, 2014, 9:54am UTC](https://forums.unrealengine.com/t/spherical-world-material-where-to-do-transformation-on-rendering-pipeline/16947 "2014-12-11T09:54:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cc49e16](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cc49e16](https://forums.unrealengine.com/u/anonymous_user_5cc49e16)\
**Post date:** [December 11, 2014, 9:54am UTC](https://forums.unrealengine.com/t/spherical-world-material-where-to-do-transformation-on-rendering-pipeline/16947/1 "2014-12-11T09:54:23Z")

</div>

Hi guys,

Right now I’m working on a spherical world build from applying material shader. Like the work Blaaguuu did on this thread [Spherical World Material Experiment - Rendering - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?32076-Spherical-World-Material-Experiment)  
You could see the video of the world differences here that I’m making right now

Normal flat world

[![]( " - YouTube") ](https://www.youtube.com/watch?v=wbg8-0oBvZo)

Spherical world after vertex transformation

[![]( " - YouTube") ](https://www.youtube.com/watch?v=fpneherEGm8)

also you could see the world before and after from images below

 ![flat.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/e/ceffd1619d78fdc9d7c2043b432907f4650be806.png)

 ![sphere.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/a/9a0773a4c57a273ee890290a6500204e17246c7e.png)

Basically what the material shader do is transforms each vertex in the flat world into spherical world via World Position Offset on material shader  
Physics and navigation works normally like a flat world, since I only change the way the world renders.

Of course this has some limitations like we can’t do a loop through the world since the world is not really “wrapped”, and each object on the world must be applied by this material so it would get the “spherical” effect.

Since I applied on the material level, I need to go back and forth disabling the material when I want to place new object on the world. Since I can only place object with the precise position on a flat world.

I’m planning to move this transformation on a more low level approach, so that every object on the world get this effect without the need of applying the material, so probably do some changes in the unreal shader usf files.

I’m searching for a way to somewhat do vertex processing right after I clicked the “Play” button on the Editor, so I could place objects on the world in the “flat” state, and right after I clicked the Play button, the vertex transformation kicks in and the world render in a spherical way. This is a better workflow I believe for this kind of process.

Is BasePassVertexShader.usf the right way to start? Where do you guys think I need to do some changes on the vertex transformation?  
Since I don’t really understand the rendering pipeline of unreal, I don’t know the exact place to do transformation, I hope the unreal devs could give some comments on this 🙂

Thoughts anyone?

Thanks for sparing your time here!  
Cheers,  
ernesernesto

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cc49e16](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cc49e16](https://forums.unrealengine.com/u/anonymous_user_5cc49e16)\
**Post date:** [December 13, 2014, 3:29am UTC](https://forums.unrealengine.com/t/spherical-world-material-where-to-do-transformation-on-rendering-pipeline/16947/2 "2014-12-13T03:29:46Z")

</div>

Updates

Currently I’m using static switch with static bool on my sphere material function to toggle between spherical effect and normal effect. This function plugged into world position offset and applied to all objects on the world.

Drawbacks from this approach is everytime I toggle the effect all objects on the world need to recompile it’s shader, took about ±5min yo finish recompiling. 2000++ shader recompile for roughly 30 different material instances. Quite a long time for iteration I guess, still searching for a better way to do this.

If anyone interested on my approach I could share my material setup

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cc49e16](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cc49e16](https://forums.unrealengine.com/u/anonymous_user_5cc49e16)\
**Post date:** [December 15, 2014, 2:43am UTC](https://forums.unrealengine.com/t/spherical-world-material-where-to-do-transformation-on-rendering-pipeline/16947/3 "2014-12-15T02:43:06Z")

</div>

I asked question on answer.unrealengine and the staff pointed out a good way to solve my problems

> **[Where to do transformation on rendering pipeline](https://forums.unrealengine.com/questions/146295/where-to-do-transformation-on-rendering-pipeline.html)**
>
> I’m working on a vertex transform shader on the material, basically what the material do is transforms each vertex in the flat world so that it would bend into spherical world via World Position Offset on material shader. Since I applied the vertex...

This made enabling the effects back and forth really quick  
Cheers
