Procházet zdrojové kódy

added getParamsMap() for jME3 performance improvements in Technique/DefineList

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11009 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
phr00t před 11 roky
rodič
revize
988fdd2f9e
1 změnil soubory, kde provedl 17 přidání a 0 odebrání
  1. 17 0
      engine/src/core/com/jme3/material/Material.java

+ 17 - 0
engine/src/core/com/jme3/material/Material.java

@@ -434,6 +434,17 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
     public Collection<MatParam> getParams() {
         return paramValues.values();
     }
+    
+    /**
+     * Returns the ListMap of all parameters set on this material.
+     *
+     * @return a ListMap of all parameters set on this material.
+     *
+     * @see #setParam(java.lang.String, com.jme3.shader.VarType, java.lang.Object)
+     */
+    public ListMap getParamsMap() {
+        return paramValues;
+    }
 
     /**
      * Check if setting the parameter given the type and name is allowed.
@@ -882,6 +893,12 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
         // When choosing technique, we choose one that
         // supports all the caps.
         EnumSet<Caps> rendererCaps = renderManager.getRenderer().getCaps();
+        
+        //workaround, always assume we support GLSL100
+        //some cards just don't report this correctly
+        if( rendererCaps.contains(Caps.GLSL100) == false )
+            rendererCaps.add(Caps.GLSL100);
+        
         if (tech == null) {
 
             if (name.equals("Default")) {