Xor Shaders
  • Tutorials
  • About

#7 Introduction to 3D part 3

8/8/2015

7 Comments

 
In the last tutorial I explained how to create 3D lights using vertex attributes. Today, I'll explain 3D distortion. The main difference is that 3D distortion is done in the vertex shader unlike our last 2 shaders. That means you can move each vertex with the vertex shader.

Flattening shapes

We will first try making a shader that flattens the 3d shapes. To do this we will simply set the z position to 0 for all vertices while leaving x and y positions unchanged. Make sure to comment out the normal attribute and use the default pass through fragment shader.
An important variable  is "object_space_pos". It is the variable we can use for setting the position.
We will use the x and y components but will use 0 instead of z.
Here is the result:

Read More
7 Comments

    Tutorials

    New tutorial at GMshaders.com!

    Categories

    All
    3D
    Beginner
    Intermediate

    Archives

    October 2021
    November 2019
    January 2019
    May 2016
    August 2015
    June 2015
    March 2015
    February 2015
    January 2015
    December 2014

    RSS Feed

Powered by Create your own unique website with customizable templates.