aboutsummaryrefslogtreecommitdiffstats
path: root/www/j3d1_4/stencil.html
blob: dfa706c4397d6b332130aadbbbfc776c80c5c9aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title>Java 3D 1.4: Stencil Buffer</title>
</head>
<body>
<h2>Java&nbsp;3D<sup><font size="-2">TM</font></sup> 1.4:
Stencil Buffer</h2>
<p><span style="color: rgb(204, 0, 0);"><i>NOTE: THIS DOES NOT INCLUDE
ANY MULTIPASS SUPPORT&nbsp;</i></span>
</p>
<p>This page describes the proposed API changes for stencil buffer
support in Java&nbsp;3D
1.4. The GraphicsConfigTemplate3D class is used to find a
GraphicsConfiguration object with the desired attributes. These
attributes include number of color bits (red, green, and blue size),
depth buffer size, and whether or not double-buffering, stereo, or
antialiasing is needed. The GraphicsConfiguration is used in turn used
to create a Canvas3D into which Java&nbsp;3D can render.<br>
</p>
<p>We propose to add a
new StencilSize attribute to GraphicsConfigTemplate3D that will allow
an application to create a Canvas3D (on-screen or off-screen) with a
stencil buffer. We also propose to add new attributes to the
RenderingAttributes object that will allow an application to control
the stencil test and update. These will work in a similar manner to the
equivalent OpenGL methods. Note that since multipass support is not yet
available, applications wishing to use stencil will need to make use of
OrderedGroup (or use mixed-mode / immediate-mode rendering).<br>
</p>
<p>The proposed API changes are:<br>
</p>
<ul>
  <li>New methods in existing classes:<br>
  </li>
  <ul>
    <pre>GraphicsConfigTemplate3D<br>    method: setStencilSize(int) // default=0<br><br>RenderingAttributes<br>    method: setStencilEnable(boolean enable)<br>    method: setStencilOp(int fail, int zfail, int zpass)<br>    method: setStencilFunc(int func, int ref, int mask)<br>    method: setStencilMask(int mask)<br></pre>
  </ul>
</ul>
<p>Issues:<br>
</p>
<ol>
  <li>How/when is the stencil buffer cleared? Implicitly at the start
of a frame? Explicitly? The latter seems problematic.<br>
    <span style="font-style: italic;">[Current plan is to clear
implicitly
at the start of each frame and not provide explicit control]</span><br>
  </li>
  <li>Does the OpenGL stencil functionality map cleanly to DirectX? If
not, then stencil support may not be available for the D3D version of
Java&nbsp;3D.<br>
  </li>
</ol>
<p><font color="gray">Page last updated &#8212;
$Date$
</font></p>
</body>
</html>