[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./Makefile Documentation/TechReports/Graphi...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./Makefile Documentation/TechReports/Graphi... |
Date: |
Tue, 10 Sep 2002 05:53:16 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/09/10 05:53:15
Modified files:
. : Makefile
Documentation/TechReports/Graphics: graphics.tex
gfx/demo : gldemo.py testtimeout.py texturelab.py
gfx/libcallgl : callgl.cxx
gfx/libos : Os-GLX.cxx
Added files:
gfx/demo/opengl: stencil.py
Log message:
A simple demonstration of using a stencil
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.160&tr2=1.161&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/TechReports/Graphics/graphics.tex.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/gldemo.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/testtimeout.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/texturelab.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/stencil.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcallgl/callgl.cxx.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libos/Os-GLX.cxx.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gzz/Documentation/TechReports/Graphics/graphics.tex
diff -c gzz/Documentation/TechReports/Graphics/graphics.tex:1.26
gzz/Documentation/TechReports/Graphics/graphics.tex:1.27
*** gzz/Documentation/TechReports/Graphics/graphics.tex:1.26 Mon Sep 2
08:59:20 2002
--- gzz/Documentation/TechReports/Graphics/graphics.tex Tue Sep 10 05:53:15 2002
***************
*** 338,341 ****
--- 338,354 ----
a vector orthogonal to that as the basis vectors, and invert
that matrix.
+ \section{Stenciled viewports}
+
+ To draw a viewport in OpenGL using stencils, there are several passes.
+ \begin{itemize}
+ \item Draw the stencil into the stencil buffer
+ \item (if depth test is desired inside) draw
+ a polygon that's very far away into the stenciled area
+ \item Draw what needs to be drawn in the stenciled area,
+ {\em without drawing any colors}.
+ \item Clear the area in the stencil buffer.
+ \end{itemize}
+ The viewport is defined by two routines, one to draw the stencil and another
to draw the image into it.
+
\end{document}
Index: gzz/Makefile
diff -c gzz/Makefile:1.160 gzz/Makefile:1.161
*** gzz/Makefile:1.160 Wed Sep 4 08:48:09 2002
--- gzz/Makefile Tue Sep 10 05:53:15 2002
***************
*** 398,403 ****
--- 398,405 ----
$(GLLIB) $(JYTHON) $(GLDEMO) gfx/demo/fillets.py
runglinfo:
$(GLLIB) $(JYTHON) $(GLDEMO) gfx/demo/glinfo.py
+ runstencil:
+ $(GLLIB) $(JYTHON) $(GLDEMO) gfx/demo/opengl/stencil.py
runppserver:
$(JYTHON) gzz/modules/pp/ppserver.py
Index: gzz/gfx/demo/gldemo.py
diff -c gzz/gfx/demo/gldemo.py:1.7 gzz/gfx/demo/gldemo.py:1.8
*** gzz/gfx/demo/gldemo.py:1.7 Wed Sep 4 18:06:00 2002
--- gzz/gfx/demo/gldemo.py Tue Sep 10 05:53:15 2002
***************
*** 1,4 ****
! # A gl demo that can reload the given file at will.
import sys
# Unfortunate debianisms XXX
--- 1,4 ----
! # A gl demo framework that can reload the given file at will.
import sys
# Unfortunate debianisms XXX
***************
*** 29,37 ****
def background(rgb):
return getDList("""
ClearColor %s %s %s 0
! Clear COLOR_BUFFER_BIT DEPTH_BUFFER_BIT
"""%rgb)
def getFont():
global font
--- 29,52 ----
def background(rgb):
return getDList("""
ClearColor %s %s %s 0
! Clear COLOR_BUFFER_BIT DEPTH_BUFFER_BIT STENCIL_BUFFER_BIT
"""%rgb)
+
+ def coloredQuad(rgb):
+ return getDList("""
+ Color %s %s %s
+ Begin QUADS
+ TexCoord 0 0
+ Vertex -1 -1
+ TexCoord 0 1
+ Vertex -1 1
+ TexCoord 1 1
+ Vertex 1 1
+ TexCoord 1 0
+ Vertex 1 -1
+ End
+ """%(rgb))
def getFont():
global font
Index: gzz/gfx/demo/testtimeout.py
diff -c gzz/gfx/demo/testtimeout.py:1.2 gzz/gfx/demo/testtimeout.py:1.3
*** gzz/gfx/demo/testtimeout.py:1.2 Wed Sep 4 18:06:00 2002
--- gzz/gfx/demo/testtimeout.py Tue Sep 10 05:53:15 2002
***************
*** 9,30 ****
def scene(self, vs):
d = w.getSize()
putnoc(vs, background((0.5,0.5,0.5)))
! vs.put(rectangle((1,0.1,0.1)), "rec", 10, self.x, 200, 150, 150)
w.addTimeout(1000, None)
return vs
-
- def rectangle(rgb):
- return getDList("""
- LineWidth 4
- Color %s %s %s
- Disable TEXTURE_2D
- Begin LINE_LOOP
- Vertex -1 -1
- Vertex -1 1
- Vertex 1 1
- Vertex 1 -1
- End
- """%(rgb))
currentScene = TimeoutScene()
--- 9,18 ----
def scene(self, vs):
d = w.getSize()
putnoc(vs, background((0.5,0.5,0.5)))
! vs.putnoc(getDList("Disable TEXTURE_2D"))
! vs.put(coloredQuad((1,0.1,0.1)), "rec", 10, self.x, 200, 150, 150)
w.addTimeout(1000, None)
return vs
currentScene = TimeoutScene()
Index: gzz/gfx/demo/texturelab.py
diff -c gzz/gfx/demo/texturelab.py:1.12 gzz/gfx/demo/texturelab.py:1.13
*** gzz/gfx/demo/texturelab.py:1.12 Fri Sep 6 07:04:58 2002
--- gzz/gfx/demo/texturelab.py Tue Sep 10 05:53:15 2002
***************
*** 1,7 ****
# A simple window for testing shaders and adjusting parameters
from __future__ import nested_scopes
- # Look at some colors...
import math
from java.lang import Math
--- 1,6 ----
Index: gzz/gfx/libcallgl/callgl.cxx
diff -c gzz/gfx/libcallgl/callgl.cxx:1.9 gzz/gfx/libcallgl/callgl.cxx:1.10
*** gzz/gfx/libcallgl/callgl.cxx:1.9 Fri Sep 6 17:36:20 2002
--- gzz/gfx/libcallgl/callgl.cxx Tue Sep 10 05:53:15 2002
***************
*** 164,175 ****
--- 164,187 ----
glBindTexture(getToken(v[1]), (GLuint)atoi(v[2].c_str()));
} else if (checkfunc(v, "DepthMask", 1)) {
glDepthMask(atoi(v[1].c_str()));
+ } else if (checkfunc(v, "ColorMask", 4)) {
+ glColorMask(atoi(v[1].c_str()),
+ atoi(v[2].c_str()),
+ atoi(v[3].c_str()),
+ atoi(v[4].c_str())
+ );
} else if (checkfunc(v, "AlphaFunc", 2)) {
glAlphaFunc(getToken(v[1]), atof(v[2].c_str()));
} else if (checkfunc(v, "DepthFunc", 1)) {
glDepthFunc(getToken(v[1]));
} else if (checkfunc(v, "BlendFunc", 2)) {
glBlendFunc(getToken(v[1]), getToken(v[2]));
+ } else if (checkfunc(v, "StencilFunc", 3)) {
+ glStencilFunc(getToken(v[1]), atoi(v[2].c_str()), atoi(v[3].c_str()));
+ } else if (checkfunc(v, "StencilOp", 3)) {
+ glStencilOp(getToken(v[1]), getToken(v[2]), getToken(v[3]));
+ } else if (checkfunc(v, "StencilMask", 1)) {
+ glStencilMask(atoi(v[1].c_str()));
} else if (checkfunc(v, "PolygonMode", 2)) {
glPolygonMode(getToken(v[1]), getToken(v[2]));
} else if (checkfunc(v, "BlendEquation", 1)) {
Index: gzz/gfx/libos/Os-GLX.cxx
diff -c gzz/gfx/libos/Os-GLX.cxx:1.6 gzz/gfx/libos/Os-GLX.cxx:1.7
*** gzz/gfx/libos/Os-GLX.cxx:1.6 Wed Aug 21 12:11:48 2002
--- gzz/gfx/libos/Os-GLX.cxx Tue Sep 10 05:53:15 2002
***************
*** 43,48 ****
--- 43,49 ----
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
+ GLX_STENCIL_SIZE, 1,
None
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./Makefile Documentation/TechReports/Graphi...,
Tuomas J. Lukka <=