protected override void DoInitialize() { this.viewportSwitch = new ViewportSwitch(); this.scissorTestSwitch = new ScissorTestSwitch(); Renderer renderer = this.Renderer; if (renderer != null) { renderer.Initialize(); } }
public DefaultRendererComponent(BuildInSceneObject buildIn, SceneObject bindingObject = null) : base(bindingObject) { var shaderCodes = new ShaderCode[2]; shaderCodes[0] = new ShaderCode(ManifestResourceLoader.LoadTextFile(@"Resources\BuildInSceneObject.vert"), ShaderType.VertexShader); shaderCodes[1] = new ShaderCode(ManifestResourceLoader.LoadTextFile(@"Resources\BuildInSceneObject.frag"), ShaderType.FragmentShader); IBufferable bufferable = GetModel(buildIn); PropertyNameMap map = GetMap(buildIn); var renderer = new Renderer(bufferable, shaderCodes, map); renderer.Initialize(); this.Renderer = renderer; }
/// <summary> /// /// </summary> /// <param name="buildIn"></param> /// <param name="bindingObject"></param> public DefaultRendererComponent(BuildInSceneObject buildIn, SceneObject bindingObject = null) : base(bindingObject) { var shaderCodes = new ShaderCode[2]; shaderCodes[0] = new ShaderCode(File.ReadAllText(@"shaders\BuildInSceneObject.vert"), ShaderType.VertexShader); shaderCodes[1] = new ShaderCode(File.ReadAllText(@"shaders\BuildInSceneObject.frag"), ShaderType.FragmentShader); IBufferable bufferable = GetModel(buildIn); PropertyNameMap map = GetMap(buildIn); var renderer = new Renderer(bufferable, shaderCodes, map); renderer.Initialize(); this.Renderer = renderer; }