Created
May 22, 2017 15:29
-
-
Save ncannasse/d7a2daf844e3d547613ee6a0974e7f2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NormalShader2D extends hxsl.Shader { | |
static var SRC = { | |
@:import h3d.shader.Base2d; | |
@param var normalMap : Sampler2d; | |
function fragment() { | |
var n = unpackNormal(normalMap.get(calculatedUV)); | |
var light = vec3(1,2,3).normalize(); | |
var lum = light.dot(n).saturate(); | |
pixelColor.rgb *= lum; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment