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
374f508f
Commit
374f508f
authored
Jul 26, 2019
by
chili
Browse files
loading diffuse textures
parent
55aefc03
Changes
2
Show whitespace changes
Inline
Side-by-side
hw3d/BindableCommon.h
View file @
374f508f
...
@@ -8,3 +8,5 @@
...
@@ -8,3 +8,5 @@
#include "TransformCbuf.h"
#include "TransformCbuf.h"
#include "VertexBuffer.h"
#include "VertexBuffer.h"
#include "VertexShader.h"
#include "VertexShader.h"
#include "Texture.h"
#include "Sampler.h"
\ No newline at end of file
hw3d/Mesh.cpp
View file @
374f508f
#include "Mesh.h"
#include "Mesh.h"
#include "imgui/imgui.h"
#include "imgui/imgui.h"
#include "Surface.h"
#include <unordered_map>
#include <unordered_map>
#include <sstream>
#include <sstream>
...
@@ -246,13 +247,6 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
...
@@ -246,13 +247,6 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
.
Append
(
VertexLayout
::
Normal
)
.
Append
(
VertexLayout
::
Normal
)
)
);
)
);
auto
&
material
=
*
pMaterials
[
mesh
.
mMaterialIndex
];
for
(
int
i
=
0
;
i
<
material
.
mNumProperties
;
i
++
)
{
auto
&
prop
=
*
material
.
mProperties
[
i
];
int
qqq
=
90
;
}
for
(
unsigned
int
i
=
0
;
i
<
mesh
.
mNumVertices
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
mesh
.
mNumVertices
;
i
++
)
{
{
vbuf
.
EmplaceBack
(
vbuf
.
EmplaceBack
(
...
@@ -274,6 +268,16 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
...
@@ -274,6 +268,16 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
std
::
vector
<
std
::
unique_ptr
<
Bind
::
Bindable
>>
bindablePtrs
;
std
::
vector
<
std
::
unique_ptr
<
Bind
::
Bindable
>>
bindablePtrs
;
if
(
mesh
.
mMaterialIndex
>=
0
)
{
using
namespace
std
::
string_literals
;
auto
&
material
=
*
pMaterials
[
mesh
.
mMaterialIndex
];
aiString
texFileName
;
material
.
GetTexture
(
aiTextureType_DIFFUSE
,
0
,
&
texFileName
);
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
Texture
>
(
gfx
,
Surface
::
FromFile
(
"Models
\\
nano_textured
\\
"
s
+
texFileName
.
C_Str
()
)
)
);
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
Sampler
>
(
gfx
)
);
}
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
VertexBuffer
>
(
gfx
,
vbuf
)
);
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
VertexBuffer
>
(
gfx
,
vbuf
)
);
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
IndexBuffer
>
(
gfx
,
indices
)
);
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
IndexBuffer
>
(
gfx
,
indices
)
);
...
...
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