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
d2b1cd65
Commit
d2b1cd65
authored
Aug 28, 2019
by
chili
Browse files
view space normal object space map
parent
617483fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
hw3d/PhongPSNormalMapObject.hlsl
View file @
d2b1cd65
...
...
@@ -17,6 +17,12 @@ cbuffer ObjectCBuf
float
padding
[
1
];
};
cbuffer
TransformCBuf
{
matrix
modelView
;
matrix
modelViewProj
;
};
Texture2D
tex
;
Texture2D
nmap
:
register
(
t2
);
...
...
@@ -33,6 +39,7 @@ float4 main( float3 viewPos : Position,float3 n : Normal,float2 tc : Texcoord )
n
.
x
=
normalSample
.
x
*
2
.
0
f
-
1
.
0
f
;
n
.
y
=
-
normalSample
.
y
*
2
.
0
f
+
1
.
0
f
;
n
.
z
=
-
normalSample
.
z
;
n
=
mul
(
n
,
(
float3x3
)
modelView
);
}
// fragment to light vector data
const
float3
vToL
=
lightPos
-
viewPos
;
...
...
hw3d/TestPlane.cpp
View file @
d2b1cd65
...
...
@@ -2,6 +2,7 @@
#include "Plane.h"
#include "BindableCommon.h"
#include "imgui/imgui.h"
#include "TransformCbufDoubleboi.h"
TestPlane
::
TestPlane
(
Graphics
&
gfx
,
float
size
)
{
...
...
@@ -29,7 +30,7 @@ TestPlane::TestPlane( Graphics& gfx,float size )
AddBind
(
Topology
::
Resolve
(
gfx
,
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST
)
);
AddBind
(
std
::
make_shared
<
TransformCbuf
>
(
gfx
,
*
this
)
);
AddBind
(
std
::
make_shared
<
TransformCbuf
Doubleboi
>
(
gfx
,
*
this
,
0u
,
2u
)
);
}
void
TestPlane
::
SetPos
(
DirectX
::
XMFLOAT3
pos
)
noexcept
...
...
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