For the term project, I have worked on Blender scene exporter. There are a lot of things which differ in terms of application in both blender and our raytracer.
Firstly Blender does not have basic material properties other than diffuse like the way our raytracer has in “Cycles Render”, however in “Blender Render” it has diffuse, specular, mirror, and transparency. Unfortunately the properties in “Blender Render” does not affect the render of “Cycles Render”, and the results of “Blender Render” is closer to our raytracer’s renders. For this reason, I created all of the materials in “Blender Render” part, but example renders are all gathered from “Cycles Render”.
Second example in this aspect is the camera. As far as I figured out (I could not find a way) to gather a camera’s image plane, and I had to make it a constant variable (-1, 1, -1, 1). However all other properties like up, forward vectors, and position of a camera can be gathered, and I could imlement the camera using these. Blender camera’s field of view can be fetched, and by fetching it I could implement simple camera of our raytracer scenes. unfortunately simple camera has some errors and needs some more work on it.
Contrarily, vertex data, mesh faces, smooth-flat shading mode etc. properties are done successfully.
Single transformations work just fine, but complex transformations do not work properly eventhough I tried to apply some solutions to solve it. If an object is transformated in edit mode there is no need to worry about the transformations of the object since parent mesh is not transformed in edit mode, but vertices of it.
The addon has the following features:
- Scene background color
- Multi sampling amount
- Light implementation
- Point Light
- Directional Light (WIP)
- Spot Light (WIP)
- Camera implementation
- Camera with image plane
- Camera with FOV (WIP)
- Vertex Data
- Texture Coordinates(WIP)
- Smooth shading WIP tag means Work In Progress which means I have done some work, but does not work properly.
Basic Blender Scene:
My raytracer’s render with the same intensity
In all the renders blender images are brighter than the renders achieved with the raytracer. In this basic box example, I made the intensity more in order to get closely bright results:
My raytracer’s render with the 10 times more intensity
Smooth And Flat Shading Scene:
In this scene all the boxes have translation, and the monkey head has 45 degree rotation on z axis.
I will keep updating this exporter in the future to use it with my OpenGL Renderer.
For more information the working branch can be checked in my github profile.