![]() |
Platforms, Frameworks & Libraries »
Windows Presentation Foundation »
General
License: The Microsoft Public License (Ms-PL)
WPF 3D - Kerkythea ExporterBy objoExport the WPF 3D scene graph to raytracing/radiosity rendering software (Kerkythea) |
C#, Windows, WPF
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
WPF 3D is a real-time rendering method. To get the highest quality renderings of 3D scenes, it is necessary to use a non real-time method that uses techniques like raytracing or radiosity. This can be done in software like Kerkythea, Luxrender, Maxwell, Indigo, etc. These engines simulate the physics of light to achieve near perfect photorealistic renderings.
This article presents an exporter that converts a WPF 3D model to the XML format used by the Kerkythea render engine.
The source code is also located at Codeplex, and I hope other developers would like to contribute to make the exporter complete.
The test model consists of four spheres and a checkerboard (a typical raytracing demo scene). with one spot light and two directional lights.
This is the raytracing output from Kerkythea. I used diffuse materials ("Whitted materials" in Kerkythea) with reflections turned on for both the spheres and the checkerboard.
The same model rendered using the metropolis light transport algorithm.
Ray tracing - Photon map - Metropolis light transport:
The WPF3D model can be exported from a Viewport3D control by the following code:
KerkytheaExporter exporter = new KerkytheaExporter(file);
exporter.BackgroundColor = Colors.Black;
exporter.Width = 1920;
exporter.Height = 1200;
exporter.Reflections = true;
exporter.Shadows = true;
exporter.SoftShadows = true;
exporter.Export(ViewPort1);
exporter.Close();
This will traverse the scene graph, find all the light sources and use the current camera of the Viewport3D.
Media3D.ModelUIElement3D class is sealed. A new base class was created for the elements used in this scene. LogicalTreeHelper?| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 10 Jul 2009 Editor: Deeksha Shenoy |
Copyright 2009 by objo Everything else Copyright © CodeProject, 1999-2010 Web22 | Advertise on the Code Project |