Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
72c14e6f
Commit
72c14e6f
authored
3 years ago
by
Lars Hoerttrich
Browse files
Options
Downloads
Patches
Plain Diff
[
#57
] Changed sizes of default images
parent
8b21b9ae
No related branches found
No related tags found
1 merge request
!44
Resolve "Material (Modul)"
Pipeline
#26022
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/material/src/vkcv/material/pbrMetallicRoughness.cpp
+20
-33
20 additions, 33 deletions
modules/material/src/vkcv/material/pbrMetallicRoughness.cpp
with
20 additions
and
33 deletions
modules/material/src/vkcv/material/pbrMetallicRoughness.cpp
+
20
−
33
View file @
72c14e6f
...
...
@@ -81,47 +81,34 @@ namespace vkcv::material
vec3
emissiveFactor
)
{
//Test if Images and samplers valid, if not use default
uint32_t
width
=
core
->
getImageWidth
(
colorImg
);
//use colorImg size as default
uint32_t
height
=
core
->
getImageHeight
(
colorImg
);
uint32_t
n
=
width
*
height
;
if
(
!
colorImg
)
{
width
=
core
->
getImageWidth
(
metRoughImg
);
// if colorImg has no size
height
=
core
->
getImageHeight
(
metRoughImg
);
n
=
width
*
height
;
vkcv
::
Image
defaultColor
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
width
,
height
);
std
::
vector
<
vec4
>
colorData
(
n
);
std
::
fill
(
colorData
.
begin
(),
colorData
.
end
(),
vec4
{
228
,
51
,
255
,
1
});
defaultColor
.
fill
(
colorData
.
data
());
if
(
!
colorImg
)
{
vkcv
::
Image
defaultColor
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
1
,
1
);
vec4
colorData
{
228
,
51
,
255
,
1
};
defaultColor
.
fill
(
&
colorData
);
colorImg
=
defaultColor
.
getHandle
();
}
if
(
!
normalImg
||
(
core
->
getImageWidth
(
normalImg
)
!=
width
)
||
(
core
->
getImageHeight
(
normalImg
)
!=
height
))
{
vkcv
::
Image
defaultNormal
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
width
,
height
);
std
::
vector
<
vec4
>
normalData
(
n
);
std
::
fill
(
normalData
.
begin
(),
normalData
.
end
(),
vec4
{
228
,
51
,
255
,
1
});
defaultNormal
.
fill
(
normalData
.
data
());
if
(
!
normalImg
)
{
vkcv
::
Image
defaultNormal
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
1
,
1
);
vec4
normalData
{
0
,
0
,
1
,
0
};
defaultNormal
.
fill
(
&
normalData
);
normalImg
=
defaultNormal
.
getHandle
();
}
if
(
!
metRoughImg
||
(
core
->
getImageWidth
(
metRoughImg
)
!=
width
)
||
(
core
->
getImageHeight
(
metRoughImg
)
!=
height
))
{
vkcv
::
Image
defaultRough
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
width
,
height
);
std
::
vector
<
vec4
>
roughData
(
n
);
std
::
fill
(
roughData
.
begin
(),
roughData
.
end
(),
vec4
{
228
,
51
,
255
,
1
});
defaultRough
.
fill
(
roughData
.
data
());
if
(
!
metRoughImg
)
{
vkcv
::
Image
defaultRough
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
1
,
1
);
vec4
roughData
{
228
,
51
,
255
,
1
};
defaultRough
.
fill
(
&
roughData
);
metRoughImg
=
defaultRough
.
getHandle
();
}
if
(
!
occlusionImg
||
(
core
->
getImageWidth
(
occlusionImg
)
!=
width
)
||
(
core
->
getImageHeight
(
occlusionImg
)
!=
height
))
{
vkcv
::
Image
defaultOcclusion
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
width
,
height
);
std
::
vector
<
vec4
>
occlusionData
(
n
);
std
::
fill
(
occlusionData
.
begin
(),
occlusionData
.
end
(),
vec4
{
228
,
51
,
255
,
1
});
defaultOcclusion
.
fill
(
occlusionData
.
data
());
if
(
!
occlusionImg
)
{
vkcv
::
Image
defaultOcclusion
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
1
,
1
);
vec4
occlusionData
{
228
,
51
,
255
,
1
};
defaultOcclusion
.
fill
(
&
occlusionData
);
occlusionImg
=
defaultOcclusion
.
getHandle
();
}
if
(
!
emissiveImg
||
(
core
->
getImageWidth
(
emissiveImg
)
!=
width
)
||
(
core
->
getImageHeight
(
emissiveImg
)
!=
height
))
{
vkcv
::
Image
defaultEmissive
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
width
,
height
);
std
::
vector
<
vec4
>
emissiveData
(
n
);
std
::
fill
(
emissiveData
.
begin
(),
emissiveData
.
end
(),
vec4
{
228
,
51
,
255
,
1
});
defaultEmissive
.
fill
(
emissiveData
.
data
());
if
(
!
emissiveImg
)
{
vkcv
::
Image
defaultEmissive
=
core
->
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
1
,
1
);
vec4
emissiveData
{
0
,
0
,
0
,
1
};
defaultEmissive
.
fill
(
&
emissiveData
);
emissiveImg
=
defaultEmissive
.
getHandle
();
}
if
(
!
colorSmp
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment