/** * 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); } }
private void addMesh(final Spatial spatial) { spatial.setTranslation( (index % wrapCount) * 8 - wrapCount * 4, (index / wrapCount) * 8 - wrapCount * 4, -50); if (spatial instanceof Mesh) { ((Mesh) spatial).updateModelBound(); } final MaterialState ms = new MaterialState(); ms.setAmbient(ColorRGBA.DARK_GRAY); spatial.setRenderState(ms); _root.attachChild(spatial); index++; }