Jump to content

GI in VOPs?


stu

Recommended Posts

Here's a hack I used to get inter-object colour bleed using sirogi's shader:

1. Render the scene as is with sirogi's radiant shader, and then save the image.

2. Make a dummy object that channel references every object in the scene and set it's UV coordinates to project from camera (the one you rendered the previous image)

3. Set up a shader that can take a texture map and is constant shaded - for the map, use the previously rendered image.

4. Apply this constant shaded shader to the object referenced object and in it's render tab, turn phantom to 1.

5. Render everything again, and you're done. It's a hack, but it's relatively painless, and it works (mostly).

stu

Link to comment
Share on other sites

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

cool trick stu!...in-camera "compositing" ;)

could come in handy for a lot of stuff....

I'm still kinda puzzled: by intre-object bleed you mean the stuff I highlighted in the image, right?

with the latest file I posted (the hippfile, not the optype) you have the option of rendering the bounce light only!

(it's the "indirect only" toggle, the spill toggle switches the whole radiant thing on and off...to get the lambertian pass)

just type in reset() in a textport (to reassign shaders to objects and cleanup stuff) then use the "mantra_bounce" ROP to render...check out the shader settings after that pass...it sets the toggle on for "indirect only"...

oh and forgot to mention....that image is the bounce light only layer...you'll need to composite it on top of another pass....kinda like what you did (cool images)...

tell me if that does it for ya!

post-9-1035402155.jpg

Link to comment
Share on other sites

-bounce only pass ("indirect only" turned on)

-blue env dome

-different colors of radiant for every obj...

(green cube, wht shpere, red cone)

composite this pass over a pass with ("indirect only" turned off)

notice how non-radiant shaders still cast a dark shadow on the ground...

notice the bright area under the big sphere, it gives the same effect when composited over the other pass in stu's example: brighten and tint the dark areas...

try inverting the last 2 images for some trippy results... :D

ok...have to stop posting now...

:rolleyes:

post-9-1035402532.jpg

Link to comment
Share on other sites

Ow - my eyes, they burn!!!

Cool pictures! Yeah, that colour bleed is exactly what I was talking about - I was just looking for a way to get it "in camera" and out of just 3D (I'm lazy B)).

After generating that image of just the bounced colour, with what compositing operation would you apply that to the basic image? I'd be inclined to do it additively but the rest of the image is white, prohibiting that approach.

I'm having altogether too much fun with this.

stu

Link to comment
Share on other sites

I'd be inclined to do it additively but the rest of the image is white, prohibiting that approach.

yup...I know exactly what you're saying...I had other examples where I only generated the inter-object spill simply by hiding the environment dome!

you get black wherever there was blue...then you can "add" it to the other layer...

in this specific case I chose to multiply it, because I only wanted it to tint the other pass...agreed, that wouldn't "brighten" the underlying layer,

sooo...I also looked in alternatives in shake and photoshop (Hard/Soft ligt maybe..overlay was harsh...) that would let you do both at the same time...

if we take out the bounce contributionfrom the underlying ...then going the additive way would be ok! (and more intuitive for lights too!) guess I did try that in my initial test frenzy....don't remember....try adding it to a straight lambertian pass... oh yeah.... I tried that....looked "correct"...but not "cool" :P

that's the reason I didn't include it in the shader yet...still have to figure out the compositing bit!...

oh...and lazyness rules! B) ...the productive kind

Link to comment
Share on other sites

here's what I was talking about:

-indirect only...same setup, same shader as above...

but with the sky turned off...adding this to a direct lighting pass (lambertian..) would give you cool spill effects...

but you lose the dark "contact shadow" bit (technical terms, eh?) ;)

PS: the green cube needs some more bias...self-reflection happening there...

post-9-1035407107.jpg

Link to comment
Share on other sites

Yeah, that contact shadow business is exactly why I chose to do it this way; the areas that shouldn't be receiving light continue not to receive light, and vice versa. I'm trying a render now that has direct light, specular highlights, and direct shadows that also conrtibute to the bounced light.

stu

Link to comment
Share on other sites

hmmm...are you using the newest hipfile or the old optype?

I tried rendering straight out of the radiant shader and...it gave me the same look you got with your composite...

maybe you're still using the old optype....

that's the image I got straight out of the sahder:

post-9-1035412891.jpg

Link to comment
Share on other sites

yes...and I think I'm onto something else too...inside the innermost loop, we're always multiplying the cumulated color of the rays with Cf...that's why you do see some spill but it's overshadowed by the fact that the area is dimly lit...maybe by changing the core behaviour of the shader, it can brightne and tint the spilled are...

ok...I ...really...have...to ...eat!

I"ll try not to check back that thread anymore today!

:D

CHEERS!

Link to comment
Share on other sites

Hey.

Same process as described above, except that now I rendered a spec pass and a shadow pass, combined them with the original radiant render, and then used that comination image as the projection from camera onto the dummy phantom objects for the final radiant render, thus tricking it into taking into account the direct illumination for the colour bleed. After this render is done, I add the spec pass (minus the shadow pass), and that's it.

Total render time on this image was about 5 minutes (hey - nothing's free) at about twice the resolution I've posted here..

Here's a sequence of images (checkerboards are cool!), from top to bottom:

1. Initial radiant render (skylight).

2. Spec pass minus shadow pass. This image represents all of the dierct illumination in the scene.

3. Second radiant render using the original render plus the spec pass as a texture map projected from camera onto duplicate dummy phantom objects reflected by the real objects. This image represents all of the indirect illumination in the scene.

4. Final image (third image + second image)

More to come.

post-9-1035478416.jpg

Link to comment
Share on other sites

mmm....spoke too soon....actually the light IS cumulative (otherwise no nice disffuse lighting and color spill...) it just gets multiplied (as per the VEX code of "anonymous" - thanks again man!) at the end with the diffuse color of the object to tint it (which is also correct light behaviour...more or less, the tinting would happen inside the cumulative loop, but since it's a multiplication you can save it to the end)...

so that's not the problem.... I guess I figured it out last night (yes, in my sleep...) and I'll work on it today....with a bit of luck, it's all gonna look good straight out of the shader...no multiple passes required...keep those fingers crossed! :)

and did I tell you those are some sweet pics? ;)

cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...