Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7d1c123a
Kaydet (Commit)
7d1c123a
authored
Ara 09, 2015
tarafından
Emmanuel Gil Peyrot
Kaydeden (comit)
Tomaž Vajngerl
Ara 11, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
slideshow: Upload the projection and modelview matrices as uniforms
Change-Id: I9d6c3ad0d2cc2f691afb2c8622471286f8a5e1c7
üst
566eca14
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
41 deletions
+51
-41
basicVertexShader.glsl
slideshow/opengl/basicVertexShader.glsl
+4
-2
reflectionVertexShader.glsl
slideshow/opengl/reflectionVertexShader.glsl
+4
-2
OGLTrans_TransitionImpl.cxx
...ource/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+39
-0
OGLTrans_TransitionImpl.hxx
...ource/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
+4
-0
OGLTrans_TransitionerImpl.cxx
...rce/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+0
-37
No files found.
slideshow/opengl/basicVertexShader.glsl
Dosyayı görüntüle @
7d1c123a
...
...
@@ -28,6 +28,8 @@
#version 120
uniform
mat4
u_projectionMatrix
;
uniform
mat4
u_modelViewMatrix
;
uniform
mat4
u_sceneTransformMatrix
;
uniform
mat4
u_primitiveTransformMatrix
;
uniform
mat4
u_operationsTransformMatrix
;
...
...
@@ -37,9 +39,9 @@ varying vec3 v_normal;
void
main
(
void
)
{
mat4
modelViewMatrix
=
gl_M
odelViewMatrix
*
u_operationsTransformMatrix
*
u_sceneTransformMatrix
*
u_primitiveTransformMatrix
;
mat4
modelViewMatrix
=
u_m
odelViewMatrix
*
u_operationsTransformMatrix
*
u_sceneTransformMatrix
*
u_primitiveTransformMatrix
;
mat3
normalMatrix
=
mat3
(
transpose
(
inverse
(
modelViewMatrix
)));
gl_Position
=
gl_P
rojectionMatrix
*
modelViewMatrix
*
gl_Vertex
;
gl_Position
=
u_p
rojectionMatrix
*
modelViewMatrix
*
gl_Vertex
;
v_texturePosition
=
gl_MultiTexCoord0
.
xy
;
v_normal
=
normalize
(
normalMatrix
*
gl_Normal
);
}
...
...
slideshow/opengl/reflectionVertexShader.glsl
Dosyayı görüntüle @
7d1c123a
...
...
@@ -28,6 +28,8 @@
#version 130
uniform
mat4
u_projectionMatrix
;
uniform
mat4
u_modelViewMatrix
;
uniform
mat4
u_sceneTransformMatrix
;
uniform
mat4
u_primitiveTransformMatrix
;
uniform
mat4
u_operationsTransformMatrix
;
...
...
@@ -38,9 +40,9 @@ varying float v_isShadow;
void
main
(
void
)
{
mat4
modelViewMatrix
=
gl_M
odelViewMatrix
*
u_operationsTransformMatrix
*
u_sceneTransformMatrix
*
u_primitiveTransformMatrix
;
mat4
modelViewMatrix
=
u_m
odelViewMatrix
*
u_operationsTransformMatrix
*
u_sceneTransformMatrix
*
u_primitiveTransformMatrix
;
mat3
normalMatrix
=
mat3
(
transpose
(
inverse
(
modelViewMatrix
)));
gl_Position
=
gl_P
rojectionMatrix
*
modelViewMatrix
*
gl_Vertex
;
gl_Position
=
u_p
rojectionMatrix
*
modelViewMatrix
*
gl_Vertex
;
v_texturePosition
=
gl_MultiTexCoord0
.
xy
;
v_normal
=
normalize
(
normalMatrix
*
gl_Normal
);
v_isShadow
=
float
(
gl_VertexID
>=
6
);
...
...
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
Dosyayı görüntüle @
7d1c123a
...
...
@@ -74,6 +74,43 @@ void OGLTransitionImpl::setScene(TransitionScene const& rScene)
maScene
=
rScene
;
}
void
OGLTransitionImpl
::
uploadModelViewProjectionMatrices
()
{
double
EyePos
(
10.0
);
double
RealF
(
1.0
);
double
RealN
(
-
1.0
);
double
RealL
(
-
1.0
);
double
RealR
(
1.0
);
double
RealB
(
-
1.0
);
double
RealT
(
1.0
);
double
ClipN
(
EyePos
+
5.0
*
RealN
);
double
ClipF
(
EyePos
+
15.0
*
RealF
);
double
ClipL
(
RealL
*
8.0
);
double
ClipR
(
RealR
*
8.0
);
double
ClipB
(
RealB
*
8.0
);
double
ClipT
(
RealT
*
8.0
);
glm
::
mat4
projection
=
glm
::
frustum
<
float
>
(
ClipL
,
ClipR
,
ClipB
,
ClipT
,
ClipN
,
ClipF
);
//This scaling is to take the plane with BottomLeftCorner(-1,-1,0) and TopRightCorner(1,1,0) and map it to the screen after the perspective division.
glm
::
vec3
scale
(
1.0
/
(((
RealR
*
2.0
*
ClipN
)
/
(
EyePos
*
(
ClipR
-
ClipL
)))
-
((
ClipR
+
ClipL
)
/
(
ClipR
-
ClipL
))),
1.0
/
(((
RealT
*
2.0
*
ClipN
)
/
(
EyePos
*
(
ClipT
-
ClipB
)))
-
((
ClipT
+
ClipB
)
/
(
ClipT
-
ClipB
))),
1.0
);
projection
=
glm
::
scale
(
projection
,
scale
);
glm
::
mat4
modelview
=
glm
::
translate
(
glm
::
mat4
(),
glm
::
vec3
(
0
,
0
,
-
EyePos
));
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"u_projectionMatrix"
);
if
(
location
!=
-
1
)
{
glUniformMatrix4fv
(
location
,
1
,
false
,
glm
::
value_ptr
(
projection
));
CHECK_GL_ERROR
();
}
location
=
glGetUniformLocation
(
m_nProgramObject
,
"u_modelViewMatrix"
);
if
(
location
!=
-
1
)
{
glUniformMatrix4fv
(
location
,
1
,
false
,
glm
::
value_ptr
(
modelview
));
CHECK_GL_ERROR
();
}
}
void
OGLTransitionImpl
::
prepare
(
sal_Int32
glLeavingSlideTex
,
sal_Int32
glEnteringSlideTex
)
{
const
SceneObjects_t
&
rSceneObjects
(
maScene
.
getSceneObjects
());
...
...
@@ -100,6 +137,8 @@ void OGLTransitionImpl::prepare( sal_Int32 glLeavingSlideTex, sal_Int32 glEnteri
CHECK_GL_ERROR
();
}
uploadModelViewProjectionMatrices
();
m_nPrimitiveTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_primitiveTransformMatrix"
);
m_nSceneTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_sceneTransformMatrix"
);
m_nOperationsTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_operationsTransformMatrix"
);
...
...
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
Dosyayı görüntüle @
7d1c123a
...
...
@@ -212,6 +212,10 @@ private:
TransitionScene
maScene
;
const
TransitionSettings
maSettings
;
/** Calculates the projection and model/view matrices, and upload them.
*/
void
uploadModelViewProjectionMatrices
();
/** Uniform location for primitive transform
*/
GLint
m_nPrimitiveTransformLocation
=
-
1
;
...
...
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
Dosyayı görüntüle @
7d1c123a
...
...
@@ -207,7 +207,6 @@ protected:
bool
useMipmap
,
uno
::
Sequence
<
sal_Int8
>&
data
,
const
OGLFormat
*
pFormat
);
static
void
prepareEnvironment
();
const
OGLFormat
*
chooseFormats
();
private
:
...
...
@@ -532,7 +531,6 @@ void OGLTransitionerImpl::impl_prepareSlides()
void
OGLTransitionerImpl
::
impl_prepareTransition
()
{
prepareEnvironment
();
if
(
mpTransition
&&
mpTransition
->
getSettings
().
mnRequiredGLVersion
<=
mnGLVersion
)
mpTransition
->
prepare
(
maLeavingSlideGL
,
maEnteringSlideGL
);
}
...
...
@@ -1014,41 +1012,6 @@ void OGLTransitionerImpl::impl_createTexture(
CHECK_GL_ERROR
();
}
void
OGLTransitionerImpl
::
prepareEnvironment
()
{
double
EyePos
(
10.0
);
double
RealF
(
1.0
);
double
RealN
(
-
1.0
);
double
RealL
(
-
1.0
);
double
RealR
(
1.0
);
double
RealB
(
-
1.0
);
double
RealT
(
1.0
);
double
ClipN
(
EyePos
+
5.0
*
RealN
);
double
ClipF
(
EyePos
+
15.0
*
RealF
);
double
ClipL
(
RealL
*
8.0
);
double
ClipR
(
RealR
*
8.0
);
double
ClipB
(
RealB
*
8.0
);
double
ClipT
(
RealT
*
8.0
);
CHECK_GL_ERROR
();
glMatrixMode
(
GL_PROJECTION
);
glm
::
mat4
projection
=
glm
::
frustum
<
float
>
(
ClipL
,
ClipR
,
ClipB
,
ClipT
,
ClipN
,
ClipF
);
//This scaling is to take the plane with BottomLeftCorner(-1,-1,0) and TopRightCorner(1,1,0) and map it to the screen after the perspective division.
glm
::
vec3
scale
(
1.0
/
(((
RealR
*
2.0
*
ClipN
)
/
(
EyePos
*
(
ClipR
-
ClipL
)))
-
((
ClipR
+
ClipL
)
/
(
ClipR
-
ClipL
))),
1.0
/
(((
RealT
*
2.0
*
ClipN
)
/
(
EyePos
*
(
ClipT
-
ClipB
)))
-
((
ClipT
+
ClipB
)
/
(
ClipT
-
ClipB
))),
1.0
);
projection
=
glm
::
scale
(
projection
,
scale
);
CHECK_GL_ERROR
();
glLoadMatrixf
(
glm
::
value_ptr
(
projection
));
CHECK_GL_ERROR
();
glMatrixMode
(
GL_MODELVIEW
);
glm
::
mat4
modelview
=
glm
::
translate
(
glm
::
mat4
(),
glm
::
vec3
(
0
,
0
,
-
EyePos
));
CHECK_GL_ERROR
();
glLoadMatrixf
(
glm
::
value_ptr
(
modelview
));
CHECK_GL_ERROR
();
}
const
OGLFormat
*
OGLTransitionerImpl
::
chooseFormats
()
{
const
OGLFormat
*
pDetectedFormat
=
nullptr
;
...
...
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