Commits

Michael Ludwig committed 4e16237

Improvements to the test renderer.

  • Participants
  • Parent commits 10bd4d2

Comments (0)

Files changed (5)

File ferox-scene/src/main/java/com/ferox/scene/controller/ffp/FixedFunctionRenderController.java

 //        TextureGroupFactory textureGroup = new TextureGroupFactory(getEntitySystem(), diffuseTextureUnit, emissiveTextureUnit, 
 //                                                                   geomGroup);
         MaterialGroupFactory materialGroup = new MaterialGroupFactory(getEntitySystem(), geomGroup);
-        LightGroupFactory lightGroup = new LightGroupFactory(getEntitySystem(), lightGroups, 8, materialGroup);
+        LightGroupFactory lightGroup = new LightGroupFactory(getEntitySystem(), lightGroups, 
+                                                             framework.getCapabilities().getMaxActiveLights(), 
+                                                             materialGroup);
         LightingGroupFactory lightingGroup = new LightingGroupFactory(materialGroup, lightGroup);
         
         final StateNode rootNode = new StateNode(lightingGroup.newGroup());
                 rendertime += (System.nanoTime() - now);
                 return null;
             }
-        }, "main");
+        });
         return future;
     }
     

File ferox-scene/src/main/java/com/ferox/scene/controller/ffp/LightGroupFactory.java

 
                         if (light.spotlightDirection != null) {
                             // configure additional spotlight parameters
-                            // FIXME: remove cast after renderer update
-                            r.setSpotlight(i, light.spotlightDirection, (float) light.cutoffAngle);
+                            r.setSpotlight(i, light.spotlightDirection, light.cutoffAngle);
                             if (light.falloff >= 0) {
                                 // the constant 15 was chosen through experimentation, basically
                                 // a value that makes lights seem bright enough but still
                                 // drop off pretty well by the desired radius
-                                r.setLightAttenuation(i, 1.0f, 0.0f, (float) (15.0 / (light.falloff * light.falloff)));
+                                r.setLightAttenuation(i, 1.0f, 0.0f, (15.0 / (light.falloff * light.falloff)));
                             } else {
                                 // disable attenuation
                                 r.setLightAttenuation(i, 1.0f, 0.0f, 0.0f);

File ferox-scene/src/main/java/com/ferox/scene/controller/ffp/SolidColorGroupFactory.java

+package com.ferox.scene.controller.ffp;
+
+import java.util.List;
+
+import com.ferox.math.ColorRGB;
+import com.ferox.renderer.FixedFunctionRenderer;
+import com.lhkbob.entreri.Entity;
+
+public class SolidColorGroupFactory implements StateGroupFactory {
+
+    @Override
+    public StateGroup newGroup() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+ 
+    private class SolidColorGroup implements StateGroup {
+
+        @Override
+        public StateNode getNode(Entity e) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public List<StateNode> getNodes() {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public AppliedEffects applyGroupState(FixedFunctionRenderer r, AppliedEffects effects) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public void unapplyGroupState(FixedFunctionRenderer r, AppliedEffects effects) {
+            // TODO Auto-generated method stub
+            
+        }
+        
+    }
+    
+    private class SolidColorState implements State {
+        private final ColorRGB rgb;
+        
+        public SolidColorState(ColorRGB rgb) {
+            
+        }
+        
+        @Override
+        public void add(Entity e) {
+            // do nothing
+        }
+
+        @Override
+        public AppliedEffects applyState(FixedFunctionRenderer r, AppliedEffects effects, int index) {
+            r.setM
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public void unapplyState(FixedFunctionRenderer r, AppliedEffects effects, int index) {
+               
+        }
+    }
+}

File ferox-scene/src/test/java/com/ferox/scene/controller/HeadlessSpeedTest.java

 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.Future;
 
 import com.ferox.math.AxisAlignedBox;
 import com.ferox.math.Matrix4;
 import com.ferox.scene.PointLight;
 import com.ferox.scene.Renderable;
 import com.ferox.scene.Transform;
-import com.ferox.scene.controller.CameraController;
-import com.ferox.scene.controller.PVSResult;
-import com.ferox.scene.controller.SpatialIndexController;
-import com.ferox.scene.controller.VisibilityController;
-import com.ferox.scene.controller.WorldBoundsController;
 import com.ferox.scene.controller.light.LightGroupController;
 import com.ferox.util.Bag;
 import com.ferox.util.geom.Box;
             }
             
             @Override
-            public void destroy() {
+            public Future<Void> destroy() {
                 // do nothing
+                return null;
             }
         }).setZDistances(0.1, 1200).setFieldOfView(75);
         

File ferox-scene/src/test/java/com/ferox/scene/controller/ffp/SimpleTest.java

 import com.ferox.math.bounds.QuadTree;
 import com.ferox.math.entreri.Vector3Property;
 import com.ferox.math.entreri.Vector3Property.DefaultVector3;
+import com.ferox.renderer.DisplayMode;
+import com.ferox.renderer.DisplayMode.PixelFormat;
 import com.ferox.renderer.Framework;
 import com.ferox.renderer.OnscreenSurface;
 import com.ferox.renderer.OnscreenSurfaceOptions;
+import com.ferox.renderer.OnscreenSurfaceOptions.MultiSampling;
 import com.ferox.renderer.impl.jogl.JoglFramework;
 import com.ferox.renderer.impl.lwjgl.LwjglFramework;
 import com.ferox.resource.VertexBufferObject.StorageMode;
 import com.ferox.scene.InfluenceRegion;
 import com.ferox.scene.PointLight;
 import com.ferox.scene.Renderable;
-import com.ferox.scene.SpecularColor;
 import com.ferox.scene.Transform;
 import com.ferox.scene.controller.CameraController;
 import com.ferox.scene.controller.SpatialIndexController;
         OnscreenSurface surface = framework.createSurface(new OnscreenSurfaceOptions()
             .setWidth(800)
             .setHeight(600)
-//            .setFullscreenMode(new DisplayMode(1440, 900, PixelFormat.RGB_24BIT))
+            .setFullscreenMode(new DisplayMode(1440, 900, PixelFormat.RGB_24BIT))
+//            .setMultiSampling(MultiSampling.FOUR_X)
             .setResizable(false));
         surface.setVSyncEnabled(false);
         
             e.add(Renderable.ID).getData().setVertices(b.getVertices())
                                           .setLocalBounds(b.getBounds())
                                           .setIndices(b.getPolygonType(), b.getIndices(), b.getIndexOffset(), b.getIndexCount());
-            if (Math.random() < .8)
+//            if (Math.random() < .9)
                 e.add(BlinnPhongMaterial.ID).getData().setNormals(b.getNormals());
             e.add(DiffuseColor.ID).getData().setColor(c);
-            e.add(SpecularColor.ID).getData().setColor(new ColorRGB(0.5, 0.5, 0.5));
+//            e.add(SpecularColor.ID).getData().setColor(new ColorRGB(0.5, 0.5, 0.5));
             e.add(Transform.ID).getData().setMatrix(new Matrix4(1, 0, 0, Math.random() * 200 - 100, 
                                                                 0, 1, 0, Math.random() * 200 - 100, 
                                                                 0, 0, 1, Math.random() * 200 - 100,