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
27a08d83
Commit
27a08d83
authored
Aug 27, 2019
by
chili
Browse files
test plane brings sampled normals into view space
parent
51a0c50e
Changes
2
Hide whitespace changes
Inline
Side-by-side
hw3d/PhongPSNormalMap.hlsl
View file @
27a08d83
...
...
@@ -17,6 +17,12 @@ cbuffer ObjectCBuf
float
padding
[
1
];
};
cbuffer
TransformCBuf
{
matrix
modelView
;
matrix
modelViewProj
;
};
Texture2D
tex
;
Texture2D
nmap
;
...
...
@@ -32,6 +38,7 @@ float4 main(float3 worldPos : 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
-
worldPos
;
...
...
hw3d/TestPlane.cpp
View file @
27a08d83
#include "TestPlane.h"
#include "Plane.h"
#include "BindableCommon.h"
#include "TransformCbufDoubleboi.h"
#include "imgui/imgui.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
...
...
hw3d_nuc_rw
@project_10_bot1
mentioned in commit
86aac23a
·
Apr 10, 2023
mentioned in commit
86aac23a
mentioned in commit 86aac23ac67211fa2ded28019d73920eba3d003b
Toggle commit list
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