Skip to content

Commit e71cf81

Browse files
committed
J3M: allow static pass lighting to be selected
1 parent 091b866 commit e71cf81

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

jme3-core/src/main/java/com/jme3/material/TechniqueDef.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ public enum LightMode {
9494
*/
9595
@Deprecated
9696
FixedPipeline,
97+
/**
98+
* Similar to {@link #SinglePass} except the type of each light is known
99+
* at shader compile time.
100+
* <p>
101+
* The advantage is that the shader can be much more efficient, i.e. not
102+
* do operations required for spot and point lights if it knows the
103+
* light is a directional light. The disadvantage is that the number of
104+
* shaders used balloons because of the variations in the number of
105+
* lights used by objects.
106+
*/
107+
StaticPass
97108
}
98109

99110
public enum ShadowMode {

jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import com.jme3.material.RenderState.FaceCullMode;
4242
import com.jme3.material.TechniqueDef.LightMode;
4343
import com.jme3.material.TechniqueDef.ShadowMode;
44+
import com.jme3.material.logic.StaticPassLightingLogic;
4445
import com.jme3.math.ColorRGBA;
4546
import com.jme3.math.Vector2f;
4647
import com.jme3.math.Vector3f;
@@ -646,6 +647,9 @@ private void readTechnique(Statement techStat) throws IOException{
646647
case SinglePass:
647648
technique.setLogic(new SinglePassLightingLogic(technique));
648649
break;
650+
case StaticPass:
651+
technique.setLogic(new StaticPassLightingLogic(technique));
652+
break;
649653
default:
650654
throw new UnsupportedOperationException();
651655
}

0 commit comments

Comments
 (0)