public static Material CreateBoundingBoxMaterial(ResourceLoader resourceLoader) { Material mat = new Material(); mat.SetShaders("BBOX_PASS", resourceLoader.LoadVertexShaderFromResource("IgnitionDX.SceneGraph.Shaders.BoundingBox.vs", Shader.Profile.vs_4_0), resourceLoader.LoadPixelShaderFromResource("IgnitionDX.SceneGraph.Shaders.BoundingBox.ps", Shader.Profile.ps_4_0)); mat.SetConstantBufferParam <Color4>("BBOX_PASS", "LineParameters", "LineColor", new Color4(1, 1, 0, 1)); return(mat); }
public static ColladaOptions GetDefaultOptions(ResourceLoader resLoader) { var options = new ColladaOptions(); options.AddShader("AMBIENT_PASS", resLoader.LoadPixelShaderFromResource("IgnitionDX.SceneGraph.Shaders.Ambient.ps", Shader.Profile.ps_4_0)); options.AddShader("AMBIENT_PASS", resLoader.LoadVertexShaderFromResource("IgnitionDX.SceneGraph.Shaders.Ambient.vs", Shader.Profile.vs_4_0)); options.AddShader("LIGHTING_PASS", resLoader.LoadPixelShaderFromResource("IgnitionDX.SceneGraph.Shaders.PhongLighting.ps", Shader.Profile.ps_4_0)); options.AddShader("LIGHTING_PASS", resLoader.LoadVertexShaderFromResource("IgnitionDX.SceneGraph.Shaders.PhongLighting.vs", Shader.Profile.vs_4_0)); options.AddShader("DIFFUSE_PASS", resLoader.LoadPixelShaderFromResource("IgnitionDX.SceneGraph.Shaders.DiffuseColor.ps", Shader.Profile.ps_4_0)); options.AddShader("DIFFUSE_PASS", resLoader.LoadVertexShaderFromResource("IgnitionDX.SceneGraph.Shaders.Ambient.vs", Shader.Profile.vs_4_0)); options.AddShader("BBOX_PASS", resLoader.LoadPixelShaderFromResource("IgnitionDX.SceneGraph.Shaders.BoundingBox.ps", Shader.Profile.ps_4_0)); options.AddShader("BBOX_PASS", resLoader.LoadVertexShaderFromResource("IgnitionDX.SceneGraph.Shaders.BoundingBox.vs", Shader.Profile.vs_4_0)); options.TextureFilter = TextureFilter.CreateLinearMipmapped(SharpDX.Direct3D11.TextureAddressMode.Wrap); ColladaAmbientLightParameters ambientParams = new ColladaAmbientLightParameters(); ambientParams.Color = new Color4(0.1f, 0.1f, 0.1f, 1); options.AmbientLight = new ConstantBuffer <ColladaAmbientLightParameters>(ambientParams); return(options); }