GithubHelp home page GithubHelp logo

bobboli / blendernoriplugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phil26at/blendernoriplugin

0.0 0.0 0.0 13.14 MB

Export blender scenes to the Nori educational raytracer. Proposed and used in the Computer Graphics course at ETH Zurich, Fall 2020

Python 100.00%

blendernoriplugin's Introduction

BlenderNoriPlugin

Export blender scenes to the Nori educational raytracer. Proposed and used by many in the Computer Graphics course at ETH Zurich, Fall 2020.

This is an extension and partial reimplementation to the official Nori plugin for Blender 2.80+ (tested on 2.90).

Installation

To use it, copy the file 'io_nori.py' into the addons/ folder of your blender installation. Then, go to Edit -> Preferences -> Add-ons -> Testing, and enable "Export Nori scenes format.". Then, you can export your scene from File -> Export -> Export Nori scenes... .

Notes

  • Only "visible" objects are exported, so by switching the eye icon of your objects on/off you can decide what to export.
  • Object instances are also supported. The exporter silently unrolls the instances into a single mesh, exports it and sets it back to the state before.
  • By enabling the option "Export lights", the exporter will export : Point Lights as point lights and Objects with a "Emission" BSDF as area lights. Thus, you can export mesh area lights to Nori. Note: For now Blender area lights are not exported (they only support simple geometry). When "Export lights" is selected, the default integrator is "path_mis", otherwise "normals".
  • By enabling the option "Export BSDF properties", the exporter will export the mesh and add a translated BSDF entry to the xml file for this object (multiple materials for different faces of a single object are also supported). Otherwise, a diffuse BSDF with the viewport color of the object is added to the XML. The following translations are currently available:
    • Principled BSDF -> disney
    • Diffuse BSDF -> diffuse
    • Specular -> mirror
    • Glass BSDF -> dielectric (also exports values for rough dielectric, so change the name in the xml afterwards if you have implemented this)
    • Glossy BSDF -> Microfacet
    • All other materials will be exported as diffuse. If you have some kind of hierarchical materials (mix shader etc), the exporter will do some heuristics to decide what to export, so change it afterwards in the XML.
  • By enabling the option "Export textures", the exporter adds a texture to your BSDF entry if available. Note that only image textures are supported atm. If no texture is found, the default BSDF color is exported. To use this feature, add an Image Texture Node and connect it to the "Color" or "Base Color" socket of your object. The path to the image will be copied relative to the blender file for now, so if you want to use the output right away save the XML in the same folder as the blender file.
  • The checkbox "Export OBJ in world coords" defines how your obj files are exported: If enabled, we export the mesh in world coordinates of Blender. Otherwise, we export the mesh in local coordinates and add a toWorld transform to the XML entry.
  • The checkbox "Triangular Mesh" exports all your meshes as triangular meshes. This is helpful if your mesh has complex polygons that Nori does not support. Note that after this export your mesh in Blender stays triangular.
  • The "Number of Camera Rays" input box sets the sampleCount parameter of your sampler.

Disclaimer

Note that the Plugin is in an early stage and thus might have its problems/limitations. I would be happy to hear your feedback, so we could improve this together. I hope it helps someone in their final projects!

blendernoriplugin's People

Contributors

phil26at avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.