mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
match lighting to more original
This commit is contained in:
parent
b5ad3b5352
commit
8984e3a496
1 changed files with 4 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ class DtsTexture extends hxsl.Shader {
|
||||||
};
|
};
|
||||||
@global var global:{
|
@global var global:{
|
||||||
@perObject var modelView:Mat4;
|
@perObject var modelView:Mat4;
|
||||||
|
@perObject var modelViewInverse:Mat4;
|
||||||
};
|
};
|
||||||
@const var additive:Bool;
|
@const var additive:Bool;
|
||||||
@const var killAlpha:Bool;
|
@const var killAlpha:Bool;
|
||||||
|
|
@ -22,6 +23,9 @@ class DtsTexture extends hxsl.Shader {
|
||||||
function vertex() {
|
function vertex() {
|
||||||
calculatedUV = input.uv;
|
calculatedUV = input.uv;
|
||||||
transformedNormal = (input.normal * global.modelView.mat3());
|
transformedNormal = (input.normal * global.modelView.mat3());
|
||||||
|
var normalizednorm = transformedNormal.normalize();
|
||||||
|
transformedNormal = transformedNormal / (transformedNormal.x * transformedNormal.x + transformedNormal.y * transformedNormal.y
|
||||||
|
+ transformedNormal.z * transformedNormal.z);
|
||||||
}
|
}
|
||||||
function fragment() {
|
function fragment() {
|
||||||
var c = texture.get(calculatedUV);
|
var c = texture.get(calculatedUV);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue