Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to create a vertex shader similar to Subway Surfers?

I'm trying to make a post processing shader/material for an infinite runner like Subway Surfers. In SS they spawn their map pieces all in a straight row then use the shader to simulate the turning. I've got a cubic lens distortion shader working from a tutorial from http://eat3d.com/free/ue4-shader-fx-cubic-lens-distortion but I can't figure out how to get it to work without a texture. The post processing effect simply shows the texture and not the rest of the game.

Can anyone point me in the right direction as to how to do this? I haven't used UE4 long, I've got more of a Unity background. Would it be possible to find and grab the material/shaders from the VR demo and use that?

Product Version: Not Selected
more ▼

asked Oct 10 '14 at 06:07 PM in Blueprint Scripting

avatar image

32 5 7 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first


I've tried to achieve the curvature effect seen in Subway Surfer with a different approach. I use a Material on the objects themselves that I would like to be affected by the curvature. It's a simple a maybe not perfect solution, I'd gladly accept any ideas to improve it.

Here is the relevant part of the material:

alt text

To utilize it, simply connect the output of the rightmost node to WorldPositionOffset input in your material.

The effect in action, with and without the connection to WorldPositionOffset:

alt text alt text

I hope it helps!

more ▼

answered Nov 14 '14 at 11:23 PM

avatar image

21 3 6 10

avatar image kdd9000 Nov 17 '14 at 07:16 PM

This works great! Thanks for the help

avatar image Kenomica Feb 01 '16 at 05:31 AM

Wow! That's fantastic, thank you for sharing.

Any way to change the direction?

avatar image Umax1004 Nov 26 '18 at 10:30 AM

Yes you can use the const3 node connected to the cross product and expose it as parameter and experiment with it to find the direction in which the effect goes and you can use -1 as a value to make the effect go in the reverse direction.

avatar image SnapDrive Aug 10 '18 at 07:24 PM

THANKS! very nice ;)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Is it possible to make pivot point a little away from camera? Something like this:

alt text

more ▼

answered Jan 31 '16 at 11:15 PM

avatar image

334 55 83 103

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question