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
6bc132f8
Kaydet (Commit)
6bc132f8
authored
Kas 23, 2015
tarafından
Emmanuel Gil Peyrot
Kaydeden (comit)
Tomaž Vajngerl
Kas 23, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
slideshow: Add back lighting in the SimpleTransition shaders
Change-Id: Iec854a8369a7a9f845f261233e46aea8097db109
üst
b8eff3af
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
basicFragmentShader.glsl
slideshow/opengl/basicFragmentShader.glsl
+6
-2
basicVertexShader.glsl
slideshow/opengl/basicVertexShader.glsl
+2
-0
reflectionFragmentShader.glsl
slideshow/opengl/reflectionFragmentShader.glsl
+6
-0
reflectionVertexShader.glsl
slideshow/opengl/reflectionVertexShader.glsl
+3
-1
No files found.
slideshow/opengl/basicFragmentShader.glsl
Dosyayı görüntüle @
6bc132f8
...
...
@@ -30,10 +30,14 @@
uniform
sampler2D
slideTexture
;
varying
vec2
v_texturePosition
;
varying
vec3
v_normal
;
void
main
()
{
// TODO: handle lighting.
gl_FragColor
=
texture2D
(
slideTexture
,
v_texturePosition
);
vec3
lightVector
=
vec3
(
0
.
0
,
0
.
0
,
1
.
0
);
float
light
=
max
(
dot
(
lightVector
,
v_normal
),
0
.
0
);
vec4
fragment
=
texture2D
(
slideTexture
,
v_texturePosition
);
vec4
black
=
vec4
(
0
.
0
,
0
.
0
,
0
.
0
,
fragment
.
a
);
gl_FragColor
=
mix
(
black
,
fragment
,
light
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
slideshow/opengl/basicVertexShader.glsl
Dosyayı görüntüle @
6bc132f8
...
...
@@ -29,11 +29,13 @@
#version 120
varying
vec2
v_texturePosition
;
varying
vec3
v_normal
;
void
main
(
void
)
{
gl_Position
=
gl_ModelViewProjectionMatrix
*
gl_Vertex
;
v_texturePosition
=
gl_MultiTexCoord0
.
xy
;
v_normal
=
normalize
(
gl_NormalMatrix
*
gl_Normal
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
slideshow/opengl/reflectionFragmentShader.glsl
Dosyayı görüntüle @
6bc132f8
...
...
@@ -31,9 +31,15 @@
uniform
sampler2D
slideTexture
;
varying
float
v_isShadow
;
varying
vec2
v_texturePosition
;
varying
vec3
v_normal
;
void
main
()
{
vec3
lightVector
=
vec3
(
0
.
0
,
0
.
0
,
1
.
0
);
float
light
=
max
(
dot
(
lightVector
,
v_normal
),
0
.
0
);
vec4
fragment
=
texture2D
(
slideTexture
,
v_texturePosition
);
vec4
black
=
vec4
(
0
.
0
,
0
.
0
,
0
.
0
,
fragment
.
a
);
fragment
=
mix
(
black
,
fragment
,
light
);
if
(
v_isShadow
>
0
.
5
)
{
if
(
v_texturePosition
.
y
>
1
.
0
-
0
.
3
)
gl_FragColor
=
mix
(
fragment
,
vec4
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
),
(
1
.
0
-
v_texturePosition
.
y
)
/
0
.
3
);
...
...
slideshow/opengl/reflectionVertexShader.glsl
Dosyayı görüntüle @
6bc132f8
...
...
@@ -28,13 +28,15 @@
#version 130
varying
float
v_isShadow
;
varying
vec2
v_texturePosition
;
varying
vec3
v_normal
;
varying
float
v_isShadow
;
void
main
(
void
)
{
gl_Position
=
gl_ModelViewProjectionMatrix
*
gl_Vertex
;
v_texturePosition
=
gl_MultiTexCoord0
.
xy
;
v_normal
=
normalize
(
gl_NormalMatrix
*
gl_Normal
);
v_isShadow
=
float
(
gl_VertexID
>=
6
);
}
...
...
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