Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
c655c310
Commit
c655c310
authored
Aug 08, 2018
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ovis: allow up to 4 active texture units
parent
f7e522a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
ovis.hpp
modules/ovis/include/opencv2/ovis.hpp
+5
-1
ovis.cpp
modules/ovis/src/ovis.cpp
+6
-3
No files found.
modules/ovis/include/opencv2/ovis.hpp
View file @
c655c310
...
...
@@ -35,7 +35,11 @@ enum MaterialProperty
MATERIAL_POINT_SIZE
,
MATERIAL_OPACITY
,
MATERIAL_EMISSIVE
,
MATERIAL_TEXTURE
MATERIAL_TEXTURE0
,
MATERIAL_TEXTURE
=
MATERIAL_TEXTURE0
,
MATERIAL_TEXTURE1
,
MATERIAL_TEXTURE2
,
MATERIAL_TEXTURE3
,
};
enum
EntityProperty
...
...
modules/ovis/src/ovis.cpp
View file @
c655c310
...
...
@@ -717,20 +717,23 @@ void setMaterialProperty(const String& name, int prop, const Scalar& val)
void
setMaterialProperty
(
const
String
&
name
,
int
prop
,
const
String
&
value
)
{
CV_Assert
(
prop
==
MATERIAL_TEXTURE
,
_app
);
CV_Assert
(
prop
>=
MATERIAL_TEXTURE0
,
prop
<=
MATERIAL_TEXTURE3
,
_app
);
MaterialPtr
mat
=
MaterialManager
::
getSingleton
().
getByName
(
name
,
RESOURCEGROUP_NAME
);
CV_Assert
(
mat
);
Pass
*
rpass
=
mat
->
getTechniques
()[
0
]
->
getPasses
()[
0
];
if
(
rpass
->
getTextureUnitStates
().
empty
())
size_t
texUnit
=
prop
-
MATERIAL_TEXTURE0
;
CV_Assert
(
texUnit
<=
rpass
->
getTextureUnitStates
().
size
());
if
(
rpass
->
getTextureUnitStates
().
size
()
<=
texUnit
)
{
rpass
->
createTextureUnitState
(
value
);
return
;
}
rpass
->
getTextureUnitStates
()[
0
]
->
setTextureName
(
value
);
rpass
->
getTextureUnitStates
()[
texUnit
]
->
setTextureName
(
value
);
}
static
bool
setShaderProperty
(
const
GpuProgramParametersSharedPtr
&
params
,
const
String
&
prop
,
...
...
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