Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Etienne Schmitt
CGoGN
Commits
3b81dd69
Commit
3b81dd69
authored
Aug 27, 2012
by
Sylvain Thery
Browse files
update ColorPerFace renderer
parent
2d102c8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Algo/Render/GL2/colorPerFaceRender.h
View file @
3b81dd69
...
@@ -48,7 +48,7 @@ namespace GL2
...
@@ -48,7 +48,7 @@ namespace GL2
/**
/**
* Class that update VBO to allow the rendering of per face color rendering
* Class that update VBO to allow the rendering of per face color rendering
*
Warning: do not use same position & color VBO than with p
er
v
ertex
rendering !
*
Use with ColorP
er
V
ertex
Shader
*/
*/
class
ColorPerFaceRender
class
ColorPerFaceRender
{
{
...
@@ -63,22 +63,36 @@ public:
...
@@ -63,22 +63,36 @@ public:
/**
/**
* update drawing buffers
* update drawing buffers
* @param vboPosition vbo of positions to update
* @param vboColor vbo of colors to update
* @param map the map
* @param map the map
* @param positions
attribute of position vertices
* @param positions attribute of position vertices
* @param colorPer
Face
attribute of color (per face,
or
per vertex per face)
* @param colorPer
XXX
attribute of color (per face, per vertex per face
, per what you want
)
* @param good selector
* @param good selector
*/
*/
template
<
typename
PFP
,
unsigned
int
ORBIT
>
template
<
typename
PFP
,
typename
ATTRIB
>
void
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
void
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
A
ttributeHandler
<
typename
PFP
::
VEC3
,
ORBIT
>
&
colorPerXXX
,
const
FunctorSelect
&
good
=
allDarts
)
;
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
A
TTRIB
&
colorPerXXX
,
const
FunctorSelect
&
good
=
allDarts
)
;
template
<
typename
PFP
,
unsigned
int
ORBIT
>
/**
* update drawing buffers
* @param vboPosition vbo of positions to update
* @param vboNormals vbo of positions to update
* @param vboColor vbo of colors to update
* @param map the map
* @param positions attribute of position vertices
* @param normals attribute of normal vertices
* @param colorPerXXX attribute of color (per face, per vertex per face, per what you want)
* @param good selector
*/
template
<
typename
PFP
,
typename
ATTRIB
>
void
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboNormals
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
void
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboNormals
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normals
,
const
A
ttributeHandler
<
typename
PFP
::
VEC3
,
ORBIT
>
&
colorPerXXX
,
const
FunctorSelect
&
good
=
allDarts
)
;
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normals
,
const
A
TTRIB
&
colorPerXXX
,
const
FunctorSelect
&
good
=
allDarts
)
;
/**
/**
* draw
* draw
* @param sh shader use to draw (here only ColorPerVertex)
*/
*/
void
draw
(
Utils
::
GLSLShader
*
sh
)
;
void
draw
(
Utils
::
GLSLShader
*
sh
)
;
...
...
include/Algo/Render/GL2/colorPerFaceRender.hpp
View file @
3b81dd69
...
@@ -49,9 +49,9 @@ m_nbTris(0)
...
@@ -49,9 +49,9 @@ m_nbTris(0)
template
<
typename
PFP
,
unsigned
int
ORBIT
>
template
<
typename
PFP
,
typename
ATTRIB
>
void
ColorPerFaceRender
::
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
void
ColorPerFaceRender
::
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
A
ttributeHandler
<
typename
PFP
::
VEC3
,
ORBIT
>
&
colorPerXXX
,
const
FunctorSelect
&
good
)
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
A
TTRIB
&
colorPerXXX
,
const
FunctorSelect
&
good
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
...
@@ -99,9 +99,10 @@ void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor
...
@@ -99,9 +99,10 @@ void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor
}
}
template
<
typename
PFP
,
unsigned
int
ORBIT
>
template
<
typename
PFP
,
typename
ATTRIB
>
void
ColorPerFaceRender
::
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboNormal
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
void
ColorPerFaceRender
::
updateVBO
(
Utils
::
VBO
&
vboPosition
,
Utils
::
VBO
&
vboNormal
,
Utils
::
VBO
&
vboColor
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normals
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
ORBIT
>&
colorPerXXX
,
const
FunctorSelect
&
good
)
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
positions
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normals
,
const
ATTRIB
&
colorPerXXX
,
const
FunctorSelect
&
good
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment