CaffeineViking / vkhr

Real-Time Hybrid Hair Rendering using Vulkan™
MIT License
446 stars 34 forks source link

Create a Scene Graph for Both Renderers #6

Closed CaffeineViking closed 6 years ago

CaffeineViking commented 6 years ago

Since both the rasterizer and the raytracer will render the same scene, we'll need a common scene structure that both use as a base to e.g. upload geometry and build acceleration structures with the correct transform and camera positions. The idea is to build a very simple format for storing this, something like this perhaps:

{
    "camera": {
        "fieldOfView": 75.0,
        "origin": [0, 0, 4],
        "lookAt": [0, 0, 0],
        "upward": [0, 1, 0]
    },

    "transform": {
        "scale":     [1, 1, 1],
        "translate": [0, 0, 0],
        "rotate": [0, 0, 0, 1],

        "models": [
            "woman/woman.obj"
        ],

        "styles": [
            "wCurly.hair"
        ]
    }
}
CaffeineViking commented 6 years ago

Almost complete, just need to shovel over code to draw each node in each respective renderer. Parser done.

CaffeineViking commented 6 years ago

Scene graph implementation complete, we'll need this, since previously rasterizer and raytracer were "split".