예제 #1
0
        public override void setupRenderCommand(StatelessRenderCommand rc)
        {
            //setup the pipeline
            rc.pipelineState.shaderState.shaderProgram = myShader;
            rc.pipelineState.vaoState.vao = myVao;
            rc.pipelineState.generateId();

            //set renderstate
            rc.renderState.setVertexBuffer(myVbo.id, 0, 0, V3T2.stride);
            rc.renderState.setIndexBuffer(myIbo.id);
            rc.renderState.setTexture(texture.id(), 0, texture.target);
            rc.renderState.setUniform(new UniformData(20, Uniform.UniformType.Int, 0));


            //setup the uniforms in the renderstate
            rc.renderState.setUniform(new UniformData(21, Uniform.UniformType.Vec4, Vector4.One));             //baseColor
            rc.renderState.setUniform(new UniformData(22, Uniform.UniformType.Float, 25.0f));                  //ailasingFactor
            rc.renderState.setUniform(new UniformData(23, Uniform.UniformType.Int, 0x00));                     //activeEffects
            rc.renderState.setUniform(new UniformData(24, Uniform.UniformType.Vec4, new Vector4(1, 0, 0, 1))); // outlineColor
//          rc.renderState.setUniform(new UniformData(25, Uniform.UniformType.Float, 0.4f)); //outlineMin_0
//          rc.renderState.setUniform(new UniformData(26, Uniform.UniformType.Float, 0.0f)); //outlineMax_0
//          rc.renderState.setUniform(new UniformData(27, Uniform.UniformType.Float, 0.0f)); //outlineMin_1
//          rc.renderState.setUniform(new UniformData(28, Uniform.UniformType.Float, 0.0f)); //outlineMax_1
            rc.renderState.setUniform(new UniformData(29, Uniform.UniformType.Vec4, new Vector4(0, 0, 0, 1)));  //glowColor
            rc.renderState.setUniform(new UniformData(30, Uniform.UniformType.Vec2, Vector2.Zero));             //glowOffset
        }
예제 #2
0
        public override void setupRenderCommand(StatelessRenderCommand rc)
        {
            //setup the pipeline
            rc.pipelineState.shaderState.shaderProgram = myShader;
            rc.pipelineState.vaoState.vao = myVao;
            rc.pipelineState.generateId();

            //set renderstate
            rc.renderState.setTexture(texture.id(), 0, texture.target);
            rc.renderState.setUniform(new UniformData(20, Uniform.UniformType.Int, 0));
        }
예제 #3
0
        public override void setupRenderCommand(StatelessRenderCommand rc)
        {
            //setup the pipeline
            rc.pipelineState.shaderState.shaderProgram = myShader;
            rc.pipelineState.vaoState.vao = myVao;

            //set renderstate
            rc.renderState.setVertexBuffer(myVbo.id, 0, 0, V3T2.stride);
            rc.renderState.setIndexBuffer(myIbo.id);
            rc.renderState.setTexture(texture.id(), 0, texture.target);
            rc.renderState.setUniform(new UniformData(20, Uniform.UniformType.Int, 0));
        }
예제 #4
0
        public override void generateRenderCommandLists()
        {
            preCommands.Clear();
            postCommands.Clear();

            preCommands.Add(new PushDebugMarkerCommand(String.Format("Pass {0}:{1}-execute", view.name, name)));

            //clear render target if needed
            if (renderTarget != null)
            {
                preCommands.Add(new SetRenderTargetCommand(renderTarget));
                if (clearTarget == true)
                {
                    preCommands.Add(new ClearColorCommand(clearColor));
                    preCommands.Add(new ClearCommand(clearMask));
                }
            }

            //called after setting render target so that any user commands inserted will affect (or change) the render target
            onPreGenerateCommands();

            stats.queueCount  = myRenderQueues.Count;
            stats.renderCalls = 0;
            stats.name        = name;
            stats.technique   = technique;

            //update the debug renderer
            DebugRenderer.update();

            List <RenderCommand> cmds = DebugRenderer.canvas.getRenderCommands();

            foreach (RenderCommand rc in cmds)
            {
                StatelessRenderCommand src = rc as StatelessRenderCommand;
                src.renderState.setUniformBuffer(view.camera.uniformBufferId(), 0);
            }

            //these are stateless commands, so no need to setup a pipeline, thats part of each command (usually the same)
            myRenderQueue.commands.AddRange(cmds);

            onPostGenerateCommands();

            postCommands.Add(new PopDebugMarkerCommand());

            stats.renderCalls += preCommands.Count;
            stats.renderCalls += postCommands.Count;
            foreach (BaseRenderQueue rq in myRenderQueues.Values)
            {
                stats.renderCalls += rq.commands.Count;
            }
        }
예제 #5
0
파일: font.cs 프로젝트: an87li/gameEngine
 public abstract void setupRenderCommand(StatelessRenderCommand rc);