/** * Sets a spatial up for being rendered with the watereffect * * @param spatial * Spatial to use as base for the watereffect */ public void setWaterEffectOnSpatial(final Spatial spatial) { spatial.setRenderState(cullBackFace); // spatial.setRenderBucketType(RenderBucketType.Skip); spatial.setRenderState(textureState); }
void applyTo(final Spatial spatial) { spatial.setRenderState(textureState); spatial.setRenderState(blendState); spatial.setRenderState(zBuffState); if (_useBlend) { spatial.getSceneHints().setRenderBucketType(RenderBucketType.PostBucket); } else { spatial.getSceneHints().setRenderBucketType(RenderBucketType.Opaque); } }
void applyTo(final Spatial spatial) { spatial.setRenderState(textureState); spatial.setRenderState(blendState); spatial.setRenderState(zBuffState); if (_useBlend) { spatial.getSceneHints().setRenderBucketType(RenderBucketType.Transparent); } else { spatial.getSceneHints().setRenderBucketType(RenderBucketType.Opaque); } }
/** * Sets a spatial up for being rendered with the watereffect * * @param spatial * Spatial to use as base for the watereffect */ public void setWaterEffectOnSpatial(final Spatial spatial) { spatial.setRenderState(cullBackFace); if (isSupported()) { // spatial.setRenderBucketType(RenderBucketType.Skip); spatial.setRenderState(waterShader); spatial.setRenderState(textureState); } else { spatial.getSceneHints().setRenderBucketType(RenderBucketType.Transparent); spatial.getSceneHints().setLightCombineMode(LightCombineMode.Off); spatial.setRenderState(fallbackTextureState); spatial.setRenderState(as1); } }
/** * Copy the render states from our source Spatial to the destination Spatial. Does not recurse. * * @param source * @param target */ private void copyRenderStates(final Spatial source, final Spatial target) { final EnumMap<StateType, RenderState> states = source.getLocalRenderStates(); for (final RenderState state : states.values()) { target.setRenderState(state); } }
private void applyCurrentMaterial(final Spatial target) { _currentMaterial.applyMaterialProperties(target); final TextureState tState = _currentMaterial.getTextureState(); if (tState != null) { target.setRenderState(tState); } final BlendState blend = _currentMaterial.getBlendState(); if (blend != null) { target.setRenderState(blend); target.getSceneHints().setRenderBucketType(RenderBucketType.Transparent); } if (_currentMaterial.illumType == 0) { target.getSceneHints().setLightCombineMode(LightCombineMode.Off); } _materialMap.put(target, _currentMaterial.getName()); }
/** * Create a copy of this spatial. * * @param shareGeometricData * if true, reuse any data fields describing the geometric shape of the spatial, as applicable. * @return the copy as described. */ public Spatial makeCopy(final boolean shareGeometricData) { final Spatial spat = duplicate(); // copy basic spatial info spat.setName(getName()); spat.getSceneHints().set(_sceneHints); spat.setTransform(_localTransform); // copy local render states for (final StateType type : _renderStateList.keySet()) { final RenderState state = _renderStateList.get(type); if (state != null) { spat.setRenderState(state); } } // copy controllers if (_controllers != null) { for (final SpatialController<?> sc : _controllers) { spat.addController(sc); } } return spat; }
/** * Create a copy of this spatial. * * @param shareGeometricData * if true, reuse any data fields describing the geometric shape of the spatial, as applicable. * @return the copy as described. */ public Spatial makeCopy(final boolean shareGeometricData) { final Spatial spat = duplicate(); // copy basic spatial info spat.setName(getName()); spat.getSceneHints().set(_sceneHints); spat.setTransform(_localTransform); // copy local render states for (final StateType type : _renderStateList.keySet()) { final RenderState state = _renderStateList.get(type); if (state != null) { spat.setRenderState(state); } } // copy controllers if (_controllers != null) { for (final SpatialController<?> sc : _controllers) { spat.addController(sc); } } return spat; }