- All Implemented Interfaces:
Transformation,Pickable,Renderable,Manageable,PersistenceCapable,Shareable,UserFields,XObject,Map,Serializable
- Direct Known Subclasses:
PerezSunSky,SpectralSkyDome
The ring geometry and per-ring solid-angle weights follow the Turtle sky
discretization used in the Sun_Sky.rgg model (Buck-Sorlin &
Henke, 2009/2013). For each ring r, the power density of each of
the 12 constituent directional lights is:
powerDensity_i = totalPower × RING_FRACTION[r] / sin(elevation[r])so that the sum ∑
powerDensity_i × sin(elevation_i) over all
72 lights equals totalPower (total diffuse horizontal irradiance).
Usage:
SkyDome sky = new SkyDome(2000.0f, 15.0f, 0.0f);
Subclasses can override buildLightEntries() to provide an
anisotropic sky radiance distribution (e.g. PerezSunSky).
Based on Sun_Sky.rgg by G. H. Buck-Sorlin and M. Henke (2009/2013).
- Author:
- MH at YNL 2026
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Node.NTypeprotected RGBColorColour of the emitted sky light (default white).protected floatHemisphere radius / distance of light nodes from the scene origin [m].static final Node.NType.Fieldprotected floatAzimuth jitter applied to all ring lights [degrees].static final Node.NType.Fieldstatic final intTotal number of sky directional lights (6 rings × 12 azimuths).protected floatTotal diffuse sky irradiance on a horizontal surface [W m⁻²].static final Node.NType.Fieldprotected booleanstatic final Node.NType.FieldFields inherited from class de.grogra.imp3d.objects.Null
transform, transform$FIELD, TRANSFORMING_MASK, transforming$FIELD, USED_BITSFields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXPLICIT_EXTENT_INDEX, explicitExtentIndex$FIELD, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IMPORT_NODE_EXTENT_INDEX, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, LAST_VISIBLE_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MAX_RESOLUTION, MIME_TYPE, MIN_RESOLUTION, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD, RESOLUTION_BIT, RESOLUTION_MASK, resolution$FIELD, TYPE_EXTENT_INDEXFields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComputes the 72 skySkyDome.LightEntryrecords for this sky dome in the node's local coordinate frame.protected static Matrix3dcalcDirection(Vector3d position) Builds the 3×3 rotation matrix that orients aDirectionalLightso that its rays travel frompositiontoward the origin.voiddraw(Object object, boolean asNode, RenderState rs) Draws a line from the origin to each of the 72 sky-element positions in the 3D viewport so the hemisphere sampling pattern is visible.Returns the sky light colour.floatfloatprotected Node.NTypeThis method returns theNode.NTypewhich describes the managed fields of the class of this node.floatbooleanprotected NodeThis method returns a new instance of the class of this node.voidComputes intersections of a given ray with this shape.voidsetColour(float r, float g, float b) Sets the sky light colour from RGB components in [0, 1].voidSets the sky light colour.voidsetDistance(float value) voidsetJitter(float value) voidsetTotalPower(float value) voidsetVisualizeDome(boolean value) voidupdate(float totalPower) Updates the total sky power and reuses existing distance and jitter.voidupdate(float totalPower, float distance, float jitter) Updates all sky dome parameters.protected LightHook for subclasses to wrap eachDirectionalLightbefore it is stored in aSkyDome.LightEntry.Methods inherited from class de.grogra.imp3d.objects.Null
getLocalTransformation, getTransform, getTransformMatrix, getTranslation, isTransforming, postTransform, preTransform, setRotation, setScale, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransforming, setTranslationMethods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dup, dupFrom, dupnew, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, findRefinementType, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIgnored, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getResolution, getShort, getSource, getStamp, getSuccessor, getSymbol, getSymbolColor, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isEncoarseOf, isExplicitExtentIndex, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExplicitExtentIndex, setExtentIndex, setGraphForDeserialization, setIgnored, setLayer, setMark, setName, setResolution, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplaceMethods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getEdgeKeys, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBitsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
-
Field Details
-
N_LIGHTS
public static final int N_LIGHTSTotal number of sky directional lights (6 rings × 12 azimuths).- See Also:
-
totalPower
protected float totalPowerTotal diffuse sky irradiance on a horizontal surface [W m⁻²]. -
distance
protected float distanceHemisphere radius / distance of light nodes from the scene origin [m]. -
visualizeDome
protected boolean visualizeDome -
jitter
protected float jitterAzimuth jitter applied to all ring lights [degrees]. A small random offset (0–15°) avoids regular sampling artefacts. -
colour
Colour of the emitted sky light (default white). -
$TYPE
-
totalPower$FIELD
-
distance$FIELD
-
visualizeDome$FIELD
-
jitter$FIELD
-
-
Constructor Details
-
SkyDome
public SkyDome()Creates a sky dome with default parameters. -
SkyDome
public SkyDome(float totalPower, float distance, float jitter) - Parameters:
totalPower- total diffuse sky irradiance [W m⁻²]distance- hemisphere radius [m]jitter- azimuth jitter [degrees, 0–15]
-
-
Method Details
-
calcDirection
Builds the 3×3 rotation matrix that orients aDirectionalLightso that its rays travel frompositiontoward the origin.Uses the same convention as
Sun: column 2 (z-axis) of the orthogonal basis is aligned withpositionbyMath2.getOrthogonalBasis(javax.vecmath.Tuple3f, javax.vecmath.Matrix3f, boolean), then negated so that the light's local +z points inward. -
draw
Draws a line from the origin to each of the 72 sky-element positions in the 3D viewport so the hemisphere sampling pattern is visible.Uses
RenderState.drawLine(javax.vecmath.Tuple3f, javax.vecmath.Tuple3f, javax.vecmath.Tuple3f, int, javax.vecmath.Matrix4d)(always drawn) rather thanRenderState.drawPoint(javax.vecmath.Tuple3f, int, javax.vecmath.Tuple3f, int, javax.vecmath.Matrix4d)(gated by the "show points" viewport option) so the visualization is always visible.- Specified by:
drawin interfaceRenderable
-
update
public void update(float totalPower) Updates the total sky power and reuses existing distance and jitter.- Parameters:
totalPower- total diffuse sky irradiance [W m⁻²]
-
update
public void update(float totalPower, float distance, float jitter) Updates all sky dome parameters.- Parameters:
totalPower- total diffuse sky irradiance [W m⁻²]distance- hemisphere radius [m]jitter- azimuth jitter [degrees, 0–15]
-
buildLightEntries
Computes the 72 skySkyDome.LightEntryrecords for this sky dome in the node's local coordinate frame.The coordinate frame is GroIMP's standard z-up system: x = east, y = north, z = up.
Override in subclasses to provide an anisotropic sky radiance distribution.
- Returns:
- array of 72
SkyDome.LightEntryobjects
-
wrapLight
Hook for subclasses to wrap eachDirectionalLightbefore it is stored in aSkyDome.LightEntry. The default returnsdlunchanged; override in e.g.SpectralSkyDome(GPUFlux module) to return aSpectralLightcarrying a custom SPD. -
getColour
Returns the sky light colour. -
setColour
Sets the sky light colour. -
setColour
public void setColour(float r, float g, float b) Sets the sky light colour from RGB components in [0, 1]. -
pick
public void pick(Object object, boolean asNode, Point3d origin, Vector3d direction, Matrix4d t, PickList list) Description copied from interface:PickableComputes intersections of a given ray with this shape.- Specified by:
pickin interfacePickable- Parameters:
object- the object of which this shape is an attributeasNode-trueiff object is a nodeorigin- the origin of the ray, in local coordinatesdirection- the direction of the ray, in local coordinatest- the transformation from local coordinates to world coordinateslist- the list to which intersections have to be added
-
getNTypeImpl
Description copied from class:NodeThis method returns theNode.NTypewhich describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.- Overrides:
getNTypeImplin classNull- Returns:
- type describing the managed fields of the class of this node
-
newInstance
Description copied from class:NodeThis method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.- Overrides:
newInstancein classNull- Returns:
- new instance of class of this node
-
isVisualizeDome
public boolean isVisualizeDome() -
setVisualizeDome
public void setVisualizeDome(boolean value) -
getTotalPower
public float getTotalPower() -
setTotalPower
public void setTotalPower(float value) -
getDistance
public float getDistance() -
setDistance
public void setDistance(float value) -
getJitter
public float getJitter() -
setJitter
public void setJitter(float value)
-