|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DefaultLineShader
This is the default line shader used in jReality.
There is an option to draw tubes around the edges, for improved visibility and
"3D readability". The radius of the tubes can be specified using setTubeRadius(Double)
.
These tubes (which are of course surfaces) will be shaded using
with the current polygon shader. In this way you can control the surface qualities of
the tubes.
If tubes are not requested, then the shader draws a more primitive version of the edges,
perhaps using a Bresenham algorithm. Here the parameters include the line width
(in pixel coordinates, default = 1), and some options for drawing dashed lines (setLineLineStipplePattern(Integer)
).
The color of the lines is set via setDiffuseColor(Color)
.
Different backends implement different versions of this shader. For example, the
software renderer (@link de.jreality.soft} always draws tubes; the specification of the tube radius is in world coordinates.
On the other hand, the JOGL backend de.jreality.jogl
can draw traditional Bresenham edges. In this case,
lighting is disabled so no shading effects are present. If tubes are enabled, then lighting is enabled, --- and the
tube radius is in object coordinates.
If the underlying geometry has vertex colors and/or edge colors attached to it, then the diffuse color is determined as
follows: if isSmoothLineShading()
returns true
then vertex colors are used and are interpolated;
if not, then edge colors, if present are used, and are constant per edge; otherwise the value of getDiffuseColor()
is used.
Note: the above explanation of coloring is not extended to the tubes, if they are requested. Here the vertex colors are ignored and the edge colors if present are used; otherwise as above.
Note: the different backends implement this shader somewhat differently.
for general remarks on these shader interfaces.
Field Summary | |
---|---|
static Object |
CREATE_DEFAULT
|
static Color |
DIFFUSE_COLOR_DEFAULT
|
static int |
LINE_FACTOR_DEFAULT
|
static boolean |
LINE_STIPPLE_DEFAULT
|
static int |
LINE_STIPPLE_PATTERN_DEFAULT
|
static double |
LINE_WIDTH_DEFAULT
|
static boolean |
SMOOTH_LINE_SHADING_DEFAULT
|
static boolean |
TUBE_DRAW_DEFAULT
|
static double |
TUBE_RADIUS_DEFAULT
|
static FrameFieldType |
TUBE_STYLE_DEFAULT
|
Fields inherited from interface de.jreality.shader.LineShader |
---|
DEFAULT_ENTITY |
Method Summary | |
---|---|
PolygonShader |
createPolygonShader(String shaderName)
|
TextShader |
createTextShader(String name)
|
Color |
getDiffuseColor()
|
Integer |
getLineFactor()
|
Boolean |
getLineStipple()
|
Integer |
getLineStipplePattern()
|
Double |
getLineWidth()
|
PolygonShader |
getPolygonShader()
|
TextShader |
getTextShader()
|
Boolean |
getTubeDraw()
|
Double |
getTubeRadius()
|
FrameFieldType |
getTubeStyle()
|
Boolean |
isSmoothLineShading()
|
void |
setDiffuseColor(Color c)
|
void |
setLineLineFactor(Integer i)
|
void |
setLineLineStipple(Boolean b)
|
void |
setLineLineStipplePattern(Integer i)
|
void |
setLineWidth(Double d)
|
void |
setSmoothLineShading(Boolean d)
|
void |
setTubeDraw(Boolean b)
|
void |
setTubeRadius(Double d)
|
void |
setTubeStyle(FrameFieldType i)
|
Field Detail |
---|
static final Object CREATE_DEFAULT
static final boolean TUBE_DRAW_DEFAULT
static final double TUBE_RADIUS_DEFAULT
static final FrameFieldType TUBE_STYLE_DEFAULT
static final boolean SMOOTH_LINE_SHADING_DEFAULT
static final double LINE_WIDTH_DEFAULT
static final boolean LINE_STIPPLE_DEFAULT
static final int LINE_STIPPLE_PATTERN_DEFAULT
static final int LINE_FACTOR_DEFAULT
static final Color DIFFUSE_COLOR_DEFAULT
Method Detail |
---|
Boolean getTubeDraw()
void setTubeDraw(Boolean b)
Double getTubeRadius()
void setTubeRadius(Double d)
FrameFieldType getTubeStyle()
void setTubeStyle(FrameFieldType i)
Double getLineWidth()
void setLineWidth(Double d)
Boolean getLineStipple()
void setLineLineStipple(Boolean b)
Integer getLineStipplePattern()
void setLineLineStipplePattern(Integer i)
Integer getLineFactor()
void setLineLineFactor(Integer i)
Boolean isSmoothLineShading()
void setSmoothLineShading(Boolean d)
Color getDiffuseColor()
void setDiffuseColor(Color c)
PolygonShader getPolygonShader()
PolygonShader createPolygonShader(String shaderName)
TextShader getTextShader()
TextShader createTextShader(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |