* 'FixedFunc' technique were wiped out entirely. Not useful since now we choose default technique based on caps anyway.

^ Make sure to fix your materials by removing the 'FixedFunc' name from your fixed pipeline techniques! Or remove then entirely if the material doesn't support OpenGL1 ...

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9546 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
Sha..rd 2012-07-10 03:56:51 +00:00
parent 55d75c5abc
commit 27e97c34da
33 changed files with 45 additions and 110 deletions

View File

@ -15,7 +15,4 @@ MaterialDef Bloom {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -30,7 +30,4 @@ MaterialDef Radial Blur {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -15,7 +15,4 @@ MaterialDef Bloom {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -55,7 +55,7 @@ MaterialDef Phong Lighting Deferred {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -275,7 +275,7 @@ MaterialDef Phong Lighting {
} }
} }
Technique FixedFunc { Technique {
LightMode FixedPipeline LightMode FixedPipeline
} }

View File

@ -2,7 +2,7 @@ MaterialDef Colored Textured {
MaterialParameters { MaterialParameters {
Texture2D ColorMap Texture2D ColorMap
Color Color Color Color (Color)
} }
Technique { Technique {
@ -14,7 +14,7 @@ MaterialDef Colored Textured {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -84,7 +84,7 @@ MaterialDef Point Sprite {
} }
} }
Technique FixedFunc { Technique {
RenderState { RenderState {
Blend AlphaAdditive Blend AlphaAdditive
// DepthWrite Off // DepthWrite Off

View File

@ -22,6 +22,6 @@ MaterialDef Sky Plane {
SPHERE_MAP : SphereMap SPHERE_MAP : SphereMap
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -4,7 +4,7 @@ MaterialDef Unshaded {
Texture2D ColorMap Texture2D ColorMap
Texture2D LightMap Texture2D LightMap
Color Color (Color) Color Color (Color)
Boolean VertexColor Boolean VertexColor (UseVertexColor)
Boolean SeparateTexCoord Boolean SeparateTexCoord
// Texture of the glowing parts of the material // Texture of the glowing parts of the material
@ -30,6 +30,9 @@ MaterialDef Unshaded {
} }
} }
Technique {
}
Technique PreNormalPass { Technique PreNormalPass {
VertexShader GLSL100 : Common/MatDefs/SSAO/normal.vert VertexShader GLSL100 : Common/MatDefs/SSAO/normal.vert
@ -42,9 +45,7 @@ MaterialDef Unshaded {
} }
RenderState { RenderState {
} }
} }
@ -63,8 +64,4 @@ MaterialDef Unshaded {
HAS_GLOWCOLOR : GlowColor HAS_GLOWCOLOR : GlowColor
} }
} }
Technique FixedFunc {
}
} }

View File

@ -37,7 +37,4 @@ MaterialDef Bloom {
DO_EXTRACT : Extract DO_EXTRACT : Extract
} }
} }
Technique FixedFunc {
}
} }

View File

@ -42,7 +42,4 @@ MaterialDef Cartoon Edge {
Resolution Resolution
} }
} }
Technique FixedFunc {
}
} }

View File

@ -34,8 +34,4 @@ MaterialDef CrossHatch {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -19,7 +19,4 @@ MaterialDef Depth Of Field {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -15,6 +15,4 @@ MaterialDef FXAA {
Resolution Resolution
} }
} }
Technique FixedFunc {
}
} }

View File

@ -27,8 +27,4 @@ MaterialDef Fade {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -32,8 +32,4 @@ MaterialDef Fade {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -32,8 +32,4 @@ MaterialDef GammaCorrection {
COMPUTE_LUMA : computeLuma COMPUTE_LUMA : computeLuma
} }
} }
Technique FixedFunc {
}
} }

View File

@ -35,7 +35,4 @@ MaterialDef Light Scattering {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -29,8 +29,4 @@ MaterialDef Default GUI {
} }
} }
Technique FixedFunc {
}
} }

View File

@ -25,8 +25,4 @@ MaterialDef Posterization {
WorldViewProjectionMatrix WorldViewProjectionMatrix
} }
} }
Technique FixedFunc {
}
} }

View File

@ -43,9 +43,4 @@ MaterialDef SSAO {
} }
} }
Technique FixedFunc {
}
} }

View File

@ -49,9 +49,4 @@ MaterialDef SSAOBlur {
RESOLVE_DEPTH_MS : NumSamplesDepth RESOLVE_DEPTH_MS : NumSamplesDepth
} }
} }
Technique FixedFunc {
}
} }

View File

@ -28,7 +28,4 @@ MaterialDef Simple Water {
CameraPosition CameraPosition
} }
} }
Technique FixedFunc {
}
} }

View File

@ -84,7 +84,4 @@ MaterialDef Advanced Water {
} }
} }
Technique FixedFunc {
}
} }

View File

@ -66,7 +66,9 @@ public class J3MLoader implements AssetLoader {
private TechniqueDef technique; private TechniqueDef technique;
private RenderState renderState; private RenderState renderState;
private String shaderLang; private String vertLanguage;
private String fragLanguage;
private String vertName; private String vertName;
private String fragName; private String fragName;
@ -93,11 +95,13 @@ public class J3MLoader implements AssetLoader {
if (typeAndLang.length != 2) { if (typeAndLang.length != 2) {
throw new IOException("Shader statement syntax incorrect: " + statement); throw new IOException("Shader statement syntax incorrect: " + statement);
} }
shaderLang = typeAndLang[1];
if (typeAndLang[0].equals("VertexShader")) { if (typeAndLang[0].equals("VertexShader")) {
vertName = split[1].trim(); vertName = split[1].trim();
vertLanguage = typeAndLang[1];
} else if (typeAndLang[0].equals("FragmentShader")) { } else if (typeAndLang[0].equals("FragmentShader")) {
fragName = split[1].trim(); fragName = split[1].trim();
fragLanguage = typeAndLang[1];
} }
} }
@ -402,7 +406,13 @@ public class J3MLoader implements AssetLoader {
if (split.length == 1) { if (split.length == 1) {
technique = new TechniqueDef(null); technique = new TechniqueDef(null);
} else if (split.length == 2) { } else if (split.length == 2) {
technique = new TechniqueDef(split[1]); String techName = split[1];
if (techName.equals("FixedFunc")) {
throw new UnsupportedOperationException(
"In material: " + key + "\nThe 'FixedFunc' technique name no longer has any special meanining.\n"
+ "To support fixed pipeline mode, remove that technique's name entirely.");
}
technique = new TechniqueDef(techName);
} else { } else {
throw new IOException("Technique statement syntax incorrect"); throw new IOException("Technique statement syntax incorrect");
} }
@ -412,14 +422,15 @@ public class J3MLoader implements AssetLoader {
} }
if (vertName != null && fragName != null){ if (vertName != null && fragName != null){
technique.setShaderFile(vertName, fragName, shaderLang); technique.setShaderFile(vertName, fragName, vertLanguage, fragLanguage);
} }
materialDef.addTechniqueDef(technique); materialDef.addTechniqueDef(technique);
technique = null; technique = null;
vertName = null; vertName = null;
fragName = null; fragName = null;
shaderLang = null; vertLanguage = null;
fragLanguage = null;
} }
private void loadFromRoot(List<Statement> roots) throws IOException{ private void loadFromRoot(List<Statement> roots) throws IOException{

View File

@ -925,14 +925,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
private void autoSelectTechnique(RenderManager rm) { private void autoSelectTechnique(RenderManager rm) {
if (technique == null) { if (technique == null) {
// NOTE: Not really needed anymore since we have technique
// selection by caps. Rename all "FixedFunc" techniques to "Default"
// and remove this hack.
if (def.getTechniqueDef("FixedFunc") != null && !rm.getRenderer().getCaps().contains(Caps.GLSL100)) {
selectTechnique("FixedFunc", rm);
} else {
selectTechnique("Default", rm); selectTechnique("Default", rm);
}
} else { } else {
technique.makeCurrent(def.getAssetManager(), false); technique.makeCurrent(def.getAssetManager(), false);
} }

View File

@ -13,7 +13,6 @@ MaterialDef Default GUI {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -12,7 +12,7 @@ MaterialDef Default GUI {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -14,7 +14,7 @@ MaterialDef Default GUI {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -35,7 +35,6 @@ MaterialDef Terrain {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -27,7 +27,6 @@ MaterialDef Terrain {
} }
} }
Technique FixedFunc { Technique {
} }
} }

View File

@ -232,7 +232,7 @@ MaterialDef Terrain Lighting {
} }
} }
Technique FixedFunc { Technique {
LightMode FixedPipeline LightMode FixedPipeline
} }