J3M: allow static pass lighting to be selected

This commit is contained in:
Kirill Vainer 2016-04-13 14:28:57 -04:00
parent 091b8664ad
commit e71cf81b96
2 changed files with 15 additions and 0 deletions

View File

@ -94,6 +94,17 @@ public class TechniqueDef implements Savable {
*/ */
@Deprecated @Deprecated
FixedPipeline, FixedPipeline,
/**
* Similar to {@link #SinglePass} except the type of each light is known
* at shader compile time.
* <p>
* The advantage is that the shader can be much more efficient, i.e. not
* do operations required for spot and point lights if it knows the
* light is a directional light. The disadvantage is that the number of
* shaders used balloons because of the variations in the number of
* lights used by objects.
*/
StaticPass
} }
public enum ShadowMode { public enum ShadowMode {

View File

@ -41,6 +41,7 @@ import com.jme3.material.RenderState.BlendMode;
import com.jme3.material.RenderState.FaceCullMode; import com.jme3.material.RenderState.FaceCullMode;
import com.jme3.material.TechniqueDef.LightMode; import com.jme3.material.TechniqueDef.LightMode;
import com.jme3.material.TechniqueDef.ShadowMode; import com.jme3.material.TechniqueDef.ShadowMode;
import com.jme3.material.logic.StaticPassLightingLogic;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f; import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
@ -646,6 +647,9 @@ public class J3MLoader implements AssetLoader {
case SinglePass: case SinglePass:
technique.setLogic(new SinglePassLightingLogic(technique)); technique.setLogic(new SinglePassLightingLogic(technique));
break; break;
case StaticPass:
technique.setLogic(new StaticPassLightingLogic(technique));
break;
default: default:
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }