embree+OSL+alembic

A picture is worth a thousand words.
stefan
Posts: 42
Joined: Wed Dec 21, 2011 8:57 pm

embree+OSL+alembic

Postby stefan » Tue Apr 17, 2012 10:42 am

Not much of rendering algorithms to see in here, more as an engineering exercise I connected embree, OSL (+OpenImageIO) and Alembic. The Octopus is a sample file from Alembic, its surface is an OSL shader and the velvet cloth is from embree's crown demo scene. My plan is to turn this into a more full featured renderer, adding differentials, MIS, motion blur, etc. Don't pay too much attention to the fps, this is a laptop from 2007.
Untitled.jpg
octopus
Untitled.jpg (104.74 KiB) Viewed 7679 times

beason
Posts: 47
Joined: Sat Dec 10, 2011 1:58 am
Location: Los Angeles, CA

Re: embree+OSL+alembic

Postby beason » Tue Apr 17, 2012 9:28 pm

Wow, that's a lot faster than my path tracer.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: embree+OSL+alembic

Postby spectral » Tue Apr 17, 2012 10:41 pm

Nice OSL shader, is it one of the OSL distribution ? Can you share ?

Thanks
Spectral
OMPF 2 global moderator

stefan
Posts: 42
Joined: Wed Dec 21, 2011 8:57 pm

Re: embree+OSL+alembic

Postby stefan » Wed Apr 18, 2012 6:49 am

The shader is really very simple, it's just using turbulence to blend between diffuse and phong:

Code: Select all

#include "nodes.h"
surface
defaultShader
    [[ string description = "default material" ]]
(
    float Kd = 1
        [[  string description = "Diffuse scaling",
            float UImin = 0, float UIsoftmax = 1 ]],
    color Cs = 1
        [[  string description = "Base color",
            float UImin = 0, float UImax = 1 ]]
  )
{
   color mixture = turbulence(P * 0.04, 8);
   Ci = Kd * Cs * diffuse(N) * mixture + (1-mixture) * phong(N, 13);
}

apaffy
Posts: 46
Joined: Thu Dec 01, 2011 11:00 pm
Location: UK
Contact:

Re: embree+OSL+alembic

Postby apaffy » Wed Apr 18, 2012 10:13 am

Nice image and great performance! How easy is it to integrate OSL into a project? I currently have my own extremely basic shader/closure system, but I would be interested in checking out OSL if it is simple to set up.

And more random question: it seems that the main target of OSL is x86, has anyone had a go at porting the shading and/or closure runtime to a GPU, and willing to share any thoughts?

stefan
Posts: 42
Joined: Wed Dec 21, 2011 8:57 pm

Re: embree+OSL+alembic

Postby stefan » Wed Apr 18, 2012 11:57 am

apaffy wrote:Nice image and great performance! How easy is it to integrate OSL into a project? I currently have my own extremely basic shader/closure system, but I would be interested in checking out OSL if it is simple to set up.

OSL is pretty easy to integrate. Depending on your OS, getting all the dependencies in order is a challenge, it's fairly simple with a Unix package manager, but trickier if you're on Windows or want to do a dependency free build on OS X (which mine is).
OSL's use of shaders and BSDFs actually fits nicely on embree's material/BSDF structures. I guess we're all just copying PBRT these days :)

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: embree+OSL+alembic

Postby spectral » Wed Apr 18, 2012 5:13 pm

Thanks for the shader, you're right it is quite simple but beautiful,

Will you open-source it ? It will be great to have a ".exe" renderer based on OSL... as reference :-)
Spectral
OMPF 2 global moderator

stefan
Posts: 42
Joined: Wed Dec 21, 2011 8:57 pm

Re: embree+OSL+alembic

Postby stefan » Thu Apr 19, 2012 5:13 pm

I have no plans for publishing it at this point - it's still full of half-broken or incomplete features and hacks. But I'll be happy to answer any questions about integrating OSL (can't say much about Alembic, I only have poly mesh import working so far, am still figuring out the rest).
Doesn't Blender's Cycles support OSL? That should be a nice reference.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: embree+OSL+alembic

Postby spectral » Thu Apr 19, 2012 5:44 pm

Thanks,

Not sure that Cycles support OSL yet, it sounds that (correct me please if I'm wrong) that the only one to (partially) support OSL is Spectral Studio (and available for download). The reason I ask this is that I will be interested to find a "downloadable" renderer, even if simple that support the OSL implementation of Sony (Spectral Studio has its own back-end for CPU and GPU support).

Thx
Spectral
OMPF 2 global moderator

stefan
Posts: 42
Joined: Wed Dec 21, 2011 8:57 pm

Re: embree+OSL+alembic

Postby stefan » Thu Apr 19, 2012 6:07 pm

If you're on Mac OS X, I can provide you with a binary, as long as you don't hold me accountable for any bugs in it ;)
I wouldn't call it a reference implementation, since I'm not supporting displacement/bump shaders and there's something wrong with transmitted rays too.


Return to “Visuals”

Who is online

Users browsing this forum: No registered users and 3 guests