static void Main(string[] args) { Bootstrapper.Configure(); var viewer = SimpleViewer.Create("Hello Veldrid Scene Graph"); viewer.SetCameraManipulator(TrackballManipulator.Create()); var root = Group.Create(); var geometry = Geometry <VertexPositionColor> .Create(); VertexPositionColor[] quadVertices = { new VertexPositionColor(new Vector2(-.75f, .75f), new Vector4(1.0f, 0.0f, 0.0f, 1.0f)), new VertexPositionColor(new Vector2(.75f, .75f), new Vector4(0.0f, 1.0f, 0.0f, 1.0f)), new VertexPositionColor(new Vector2(-.75f, -.75f), new Vector4(0.0f, 0.0f, 1.0f, 1.0f)), new VertexPositionColor(new Vector2(.75f, -.75f), new Vector4(1.0f, 1.0f, 0.0f, 1.0f)) }; geometry.VertexData = quadVertices; uint[] quadIndices = { 0, 1, 2, 3 }; geometry.IndexData = quadIndices; geometry.VertexLayout = new VertexLayoutDescription( new VertexElementDescription("Position", VertexElementSemantic.TextureCoordinate, VertexElementFormat.Float2), new VertexElementDescription("Color", VertexElementSemantic.TextureCoordinate, VertexElementFormat.Float4)); var pSet = DrawElements <VertexPositionColor> .Create( geometry, PrimitiveTopology.TriangleStrip, (uint)geometry.IndexData.Length, 1, 0, 0, 0); geometry.PrimitiveSets.Add(pSet); geometry.PipelineState.VertexShaderDescription = Vertex2Color4Shader.Instance.VertexShaderDescription; geometry.PipelineState.FragmentShaderDescription = Vertex2Color4Shader.Instance.FragmentShaderDescription; var geode = Geode.Create(); geode.AddDrawable(geometry); root.AddChild(geode); viewer.SetSceneData(root); viewer.ViewAll(); viewer.Run(); }
static void Main(string[] args) { Bootstrapper.Configure(); var logger = Veldrid.SceneGraph.Logging.LogManager.CreateLogger <Program>(); var viewer = SimpleViewer.Create("Phong Shaded Dragon Scene Graph"); viewer.SetCameraManipulator(TrackballManipulator.Create()); var root = LightingExampleScene.Build(); viewer.SetSceneData(root); viewer.ViewAll(); viewer.Run(); }
static void Main(string[] args) { Bootstrapper.Configure(); var logger = Veldrid.SceneGraph.Logging.LogManager.CreateLogger <Program>(); var viewer = SimpleViewer.Create("Path Shape Example"); viewer.SetCameraManipulator(TrackballManipulator.Create()); // Build the path scene var root = PathExampleScene.Build(); viewer.SetSceneData(root); viewer.ViewAll(); viewer.Run(); }
static void Main(string[] args) { Bootstrapper.Configure(); var viewer = SimpleViewer.Create("Text Rendering Demo"); viewer.SetCameraManipulator(TrackballManipulator.Create()); var root = Group.Create(); var textNode = TextNode.Create("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"); var geode = Geode.Create(); geode.AddDrawable(textNode); root.AddChild(geode); viewer.SetSceneData(root); viewer.ViewAll(); viewer.Run(); }
internal PathExampleViewModel() : base() { SceneRoot = Examples.Common.PathExampleScene.Build(); CameraManipulator = TrackballManipulator.Create(); }
public LightingDemoViewModel() : base() { SceneRoot = Examples.Common.LightingExampleScene.Build(); CameraManipulator = TrackballManipulator.Create(); }