Skip to content

Normal offset application in vertex shader? #250

@solomon-gumball

Description

@solomon-gumball

This line should be in the fragment shader.

vec3 invertedNormals = a_normals + (u_normals.x < 0.0 ? calculateOffset(u_normals) * 2.0 - 1.0 : vec3(0.0));

Which requires some refactors to the vertex shader.

This will apply the normal texture on a per fragment basis versus a per vertex basis, which makes a lot more sense for textures.

TLDR: If you don't have enough vertices it looks like this:
screen shot 2015-06-08 at 12 38 37 pm
When it should look like this:
screen shot 2015-06-08 at 12 38 56 pm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions