[Addon] Corona Render Exporter v1.9.2


(ohsnapitsjoel) #1

Update: The exporter is not being actively developed while I am busy with projects. Development should pick back up at a later date.

Corona Renderer is a new renderer developed by Ondra Karlik. It’s available as a 3DS Max plugin or as a standalone renderer. While the standalone renderer doesn’t support as many features as the Max plugin, it’s still very fast, very powerful, and can produce very high quality images using a number of different biased and unbiased rendering algorithms.

You can download Corona Standalone binaries here.

Download the Blender exporter on bitbucket: https://bitbucket.org/ohsnapitsjoel/render_corona

https://vimeo.com/81228121

Standalone features (and exporter features) include:
  • Diffuse, specular color, translucency, opacity, reflection, anisotropy / anisotropy rotation, refraction, normal, and emission image textures
  • Instances / dupligroups / object and group particle systems
  • Hair particle systems export as renderable geometry
  • Mesh lights
  • Physically correct sun and sky (Hosek-Wilkie sky model)
  • Environment texture mapping (latlong maps only)
  • Physically correct depth of field
  • Unbiased/consistent rendering with path tracing, bidirectional path tracing
  • Biased rendering with HD Cache
  • Progressive and bucket rendering modes
  • Blender material conversion to Corona material
  • Render passes
  • Orthographic camera
  • Portal materials
  • Normal mapping
  • Material anisotropy
  • Binary .obj export
  • Per-material ‘rounded corners’ rendering
  • Node system including mix / fresnel / ao / ray switch shaders / texture node / offset & scaling node
  • Camera, object, and deformation motion blur
  • Cython compiled mesh export to reduce export times (by more than 50% compared to regular Python export)
To install and use:
  • Download the exporter from bitbucket, from the “Downloads” section
  • Extract the exporter and place it in your /scripts/addons directory.
  • Enable the exporter in Blender’s User Preferences > Render category.
  • In the Corona Render user preferences, set the path to the Corona Standalone directory containing Corona.exe
  • Select Corona as the renderer from the render engine dropdown.
  • Set the export path.
  • Render. Large scenes may take a while to export and load in Corona, so be patient.

Exporter To do list:

  • Camera shift

Warnings:

  • Only UV-mapped image textures of formats PNG, EXR, BMP, JPEG, TGA, TIFF, GIF are supported. Other projections and texture types are not supported.
  • Some non-manifold and loose geometry (vertices, edges) will break rendering. Geometry should to be clean. Check the console for errors if rendering fails; Corona will report which .obj files are giving it trouble.

Thanks to Franz Beaune and Esteban Tovagliari for the original Appleseed export code and their continued help with that, much of which was used for this exporter.


(Spirou4D) #2

Salut Joel,
J’ai bien aimé ton addon Xnormal et ton site google+. I see today you are crazy of python too.
To reply to your question: personally I perfer using a mostly generic and familiar BI UI.
And Corona renderer’s web site tell us “Corona is easy to use” : Amazing, the blender exporter must be simple then! No?
If I observe the corona/doc, you have a lot of job!
Good luck! :wink:
Bye
Spirou4D


(matali) #3

Hi Joel,
Thanks for your commitment. The Luxexporter is a good example I think. Having a button to convert BI Materials and also a PyNodes node system. The Mitsuba exporter is based on it. Maybe you can do the same (start to modify their exporter for corona) ? It would be faster than writing from scratch and :

  1. Having a Node System like in Cycles and Lux now (soon mitsuba ?) would be better for people not too learn different UI type for every renderer.
  2. People stick to a renderer because they don’t want to relearn x time to build materials and to loose all their assets. Being able to just click on “convert materials” on a already configured BI blend file and having it render correctly in Corona would give that renderer a really big library of assets with blendswap also. The importers (obj, collada, …) also imports materials as BI materials, so if your script can convert that to corona materials transparently, it would spare a lot of time to the artist.

(Atom) #4

Currently, it is free to use, but there are plans to make it commercial in the future

I guess I did not consider Corona an option for development because it will not be Free in the future.


(ohsnapitsjoel) #5

Hi matali, thanks for the input. I initially thought about using that as a template, because it’s a very nice UI. I might just design a UI that looks a lot like that.

But Mitsuba and Luxrender have a lot of similarities in terms of what they’re exporting. Corona is pretty different. Corona Standalone reads .obj files and .mtl files, so one could basically just export a basic BI scene as a triangulated .obj + .mtl, and Corona should be able to read it (with a few tweaks to the .mtl file, like texture paths). So in some sense, materials don’t even need to be ‘converted’ to anything.

Corona has material parameters like ‘refractFresnel’, ‘reflectFresnel’, etc., that don’t exist in an .mtl file unless I explicitly export them in the exporter. These are the kinds of things that I’m curious whether people want exposed in the UI - do you want to see things like ‘Fresnel Refraction’ in the UI, or just use the BI material system and have parameters like ‘refractFresnel’ calculated behind the scenes?

If they’re exposed, I can definitely add an operator to convert materials to Corona materials, no problem.

About PyNodes - that’s gonna take some serious research for me. I haven’t dug into that at all yet. Though I do believe Atom has! :wink:

@Atom - yeah, but I think that’s gonna be a while. It’s been free for a long time, and I imagine it’ll stay that way for a while. I could be wrong. Also I thought that he said that there will be free versions alongside commercial versions in the future? Don’t quote me on that though…

But even if it goes completely commercial, it’ll still need an exporter (like Octane, V-Ray, Maxwell, etc.).


(ohsnapitsjoel) #6

Haha, yes, “simple.” Of course. At this point I think I’m leaning toward not using BI’s generic panels, but exposing specific Corona parameters to the UI.


(Spirou4D) #7

Yes you’re right! Some parameters to begin…


(elindell) #8

ohsnapitsjoel, here’s a blend file with the corona export script I mentioned in the other thread. I’ve included a readme text explaining how everything works in detail but I’ll run down the basics here.

My script iterates through the scene objects and looks for “Camera” and “Target”, which should be an empty the camera is ‘trackto’ constrained. The Target is there so I don’t have to figure out all that matrix stuff you were having trouble with. After that it will go through and export all mesh items using blenders export_object operator but with parameters that corona needs (triangles).

After that it creates the material. Here’s where most of my work came in. I created a node group called Corona Group, its an ubershader that works similar to how 3dsmax corona material works. To export properly every object needs this material group. I’ve tried to make it so that you can setup a scene with cycles and get similar results in corona.

I don’t have any of the configuration part of the render exposed in blender and not sure what would be the best direction, I guess that’s what you’re trying to figure out here. So I guess what I have is the skeleton of a material converter, it sounds like you are interested in creating the UI for the render settings? Perhaps we should join forces?

Some notes about the exporter, first please read the Readme in the blend file, but basically have a Camera and Target, all materials must use corona group node tree, and make sure the node group is named “Corona Group”. Set your directory at the top of the script. If you’ve exported a scene but changed only material settings there’s a second script that excludes the object export, this could save a lot of time if the meshes are heavy.

All of these steps I hope to implement in a more friendly fashion, I just wanted to get this out there as a sort of proof of concept, use cycles as a fast GPU preview then send it over to the fast CPU render.

Some examples below (5 min on 480gtx for cycles, 5 min on i7 950 for corona, neither render optimized for speed just using default settings).




Corona_Exporter_July_8_2013.blend (4.17 MB)


(ohsnapitsjoel) #9

Wow, very impressive matching of Cycles and Corona materials. I’ll take a look at the .blend later tonight.

Yes, I was planning to implement panels for all the render properties, render passes, and camera properties (or at least, all the ones I could figure out anyway. There are a few that I don’t understand anything about, since I can’t find an obvious parallel in the interactive docs).

I like the idea of a node group, since that’s a pretty nice workflow now that people are getting used to Cycles. I think there should be a default material that gets exported, though, instead of requiring every object to have the node group - does export or rendering fail if an object doesn’t have the node group? Are you using PyNodes, by the way?

Maybe better than iterating through the scene and looking for objects with very specific names (since a user is apt to change those), you can use a prop_search property or an EnumProperty (with a function to find only ‘Empty’ objects in the scene) in the UI to select the ‘Target’ empty. That’s a good workaround, though, for the time being! Very clever.


(elindell) #10

nope, no pynodes, I don’t quite grasp those yet but I don’t think they are neccessary…at least from the point of view of converting cycles materials to corona

The node group is basically an ubershader and the script will fail if an object doesn’t have one, but couldn’t the same be said of any external renderer and the internal program, ie in 3dsmax if an object doesn’t have a corona material it will render a red emission shader… actually thats a good idea I’ll add that, if the script can’t find the proper materials it defaults to a bright pink or something.


(ohsnapitsjoel) #11

I’d like to look into PyNodes this week, if I get the chance.


(ohsnapitsjoel) #12

I think we definitely should combine our efforts. I’ve just added panels and properties for every render setting I could figure out. I think my layout might be a little cluttered and maybe a little claustrophobia-inducing, but it works for now.

I have an idea; I really like your idea of using Cycles nodes. I’ll PM you about it.


(ohsnapitsjoel) #13

Updated the top of the page with what I have so far.

Most things work; let me know if you have any questions. Please report bugs to the bitbucket tracker.


(amigoface1975) #14

very nice !,

i was really pleased by the corona render , especially for speed, and it’s a cpu only render engine !


(matali) #15

Hi Joel,
I can’t get the exporter to render. Your exporter seems to work well (the scn and obj… are created). I tried to render with the command line, i get the error that wx…vc_custom.dll is missing. I tried to copy the dll from WxWidget in the corona exe folder and in system32, I have all vc_redist from 2005 to 2010, I tried on xp and Win7, no success. Any Idea ?


(ohsnapitsjoel) #16

Nope, not yet, sorry :frowning: I haven’t done any experiments at all with command line rendering; I just enabled it in the dropdown as a placeholder for when I can get around to experimenting. I may or may not have the same trouble, I’ll have to let you know.


(Remade) #17

thanks for developing this addon.corona renders look very impressive.


(ohsnapitsjoel) #18

Update 7/14/13 - added elindell’s Cycles node conversion code, and a button in the node editor UI for creating his ubershader node network. So you can now use his method of previewing materials in Cycles, then exporting them to Corona. Textures are not supported yet with this, however.
-objects are exported as individual .obj files instead of one large one
-Some bug fixes


(holyenigma74) #19

where does Corona install to?

I installed it, but where does it nistall on the computer? i.e. location…

it said it installed correctly however i cant find it.


(holyenigma74) #20

Ok i figured out how to get the installer to pick a location,
however when it “installs” it only unpacks dll’s i don’t get an exe…

anyone else have this problem?