Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
e82fcbbf
Commit
e82fcbbf
authored
Aug 04, 2019
by
chili
Browse files
better, but look at that y-axis bs...
parent
a1bca09b
Changes
1
Hide whitespace changes
Inline
Side-by-side
hw3d/PhongPSNormalMap.hlsl
View file @
e82fcbbf
...
@@ -28,7 +28,10 @@ float4 main(float3 worldPos : Position, float3 n : Normal, float2 tc : Texcoord)
...
@@ -28,7 +28,10 @@ float4 main(float3 worldPos : Position, float3 n : Normal, float2 tc : Texcoord)
// sample normal from map if normal mapping enabled
// sample normal from map if normal mapping enabled
if
(
normalMapEnabled
)
if
(
normalMapEnabled
)
{
{
n
=
-
nmap
.
Sample
(
splr
,
tc
).
xyz
;
const
float3
normalSample
=
nmap
.
Sample
(
splr
,
tc
).
xyz
;
n
.
x
=
normalSample
.
x
*
2
.
0
f
-
1
.
0
f
;
n
.
y
=
normalSample
.
y
*
2
.
0
f
-
1
.
0
f
;
n
.
z
=
-
normalSample
.
z
;
}
}
// fragment to light vector data
// fragment to light vector data
const
float3
vToL
=
lightPos
-
worldPos
;
const
float3
vToL
=
lightPos
-
worldPos
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment