PDA

View Full Version : ctrl.occlusion


francescaluce
05-17-2006, 01:37 AM
Ehya guys.

we're a refining an advanced occlusion shader.
so far we got directional occlusion plus color bleeding
but also multilevel transparency should be supported
shortly. usual environment lookup, bent normals and
fg.occlusion also supported.

here some funny scenes where you can test our shader.



demo001 (http://www.arteoff.it/ctrl_shaders/ctrl_occlusion_demo001.rar)
http://img367.imageshack.us/img367/741/demo0018fb.th.jpg (http://img367.imageshack.us/my.php?image=demo0018fb.jpg)
**
a simple scene with an animated light
and with ctrl.occlusion simulating area
shadows. it is up to 2x time faster than
normal area shadows.



demo002 (http://www.arteoff.it/ctrl_shaders/ctrl_occlusion_demo002.rar)
http://img125.imageshack.us/img125/8370/demo0028yg.th.jpg (http://img125.imageshack.us/my.php?image=demo0028yg.jpg)
**
raytrace shadows from a spot light plus
ctrl.occlusion to give it area and contact
shadows.



demo003 (http://www.arteoff.it/ctrl_shaders/ctrl_occlusion_demo003.rar)
http://img114.imageshack.us/img114/7862/demo0037ea.th.jpg (http://img114.imageshack.us/my.php?image=demo0037ea.jpg)
**
occlusion to simulate area light
in a fg environment. we use also
ctrl.rays to supply fewer occ samples
to the fg precomputing phase, speeding
up dramatically the rendering.



demo004 (http://www.arteoff.it/ctrl_shaders/ctrl_occlusion_demo004.rar)
http://img519.imageshack.us/img519/3150/demo0041hg.th.jpg (http://img519.imageshack.us/my.php?image=demo0041hg.jpg)
**
here a color bleeding with occlusion
as shadow under different materials.



demo005 (http://www.arteoff.it/ctrl_shaders/ctrl_occlusion_demo005.rar)
http://img130.imageshack.us/img130/7577/demo0054ny.th.jpg (http://img130.imageshack.us/my.php?image=demo0054ny.jpg)
**
we use the new ctrl.rays to tweak
ctrlocc rays to play as we could do
with eye rays against reflect/refract
rays for example. in other words we
supply a different color just for the
color bleeding.



demo006 (http://www.arteoff.it/ctrl_shaders/ctrl_occlusion_demo006.rar)
http://img284.imageshack.us/img284/5678/ctrloccdirtshad1fa.th.jpg (http://img284.imageshack.us/my.php?image=ctrloccdirtshad1fa.jpg)
**
a trick to simulate hair shadows.
note that I plugged on the fly a fractal
but by tweaking it or using a painted map
could be achived better results. there's a
box visible only to trace rays with the same
color of the hairs. we use a directional occlusion
plus color bleeding to simulate soft transparent
hair shadows.




**
a couple of thoughts about this shader.
don't bother too much trying to applying some
global solutions. it is not a one click setup. and
it is not done for that. use area shadows and
fg to get that as usual. infact even if you could
accomplish that, it is more targeted for guys that
wanna build up their scenes and setting up locally
their materials avoiding expensive computations
like finalgathering and area shadows. probably for
classic light shading setups, those done in production
pipelines. the color bleeding is in any way phisical, it
does only one bounce and also some optimization that
sometimes could not give you what you're looking for;
it just returns some fast subtle color blending to avoid
excessive use of ambient lights and classic tricks to
simulate global illumination. you can use the ctrl.rays
to get even faster calculations and to support the
usual way mentalray deals with traced rays. there're
also still some bugs that will be resolved probably
when transparency will be supported. I mean the
occlusion should obey colored transparency and so
something will be adjusted at that point.


**
for the scenes only you'll need also ctrl.rays and
ctrl.xshading. ctrl.occlusion itself does not require
them.

.ctrl.xshading (http://www.arteoff.it/ctrl_shaders/ctrl_xshading.rar)
.ctrl.rays (http://www.arteoff.it/ctrl_shaders/ctrl_rays_v1.2.rar)

.ctrl.occlusion_v1.6d (http://www.arteoff.it/ctrl_shaders/ctrl.occlusion_v1.6d.rar)



ciao
francesca

mr Bob
05-17-2006, 03:22 AM
outstanding shader dev work there francescaluce.............


B

Spacelord
05-17-2006, 03:40 AM
Go Fran !!

gy615
05-17-2006, 08:44 AM
Really cooool.It`s faster than XSI`s ao_shader.thanks francescaluce. I can`t waiting for the new ctrl_xshading have reflection toggle.I will use the ctrl_xshading instead of DSG_shader.

mdee
05-17-2006, 09:24 AM
Thank you very much Francesca!

mocaw
05-17-2006, 07:38 PM
It's nice to have a sophisticated AO shader now. Thank you for all of your hard work.

EternalArt
05-17-2006, 10:29 PM
Amazing .. Thank you

CiaranM
05-18-2006, 12:22 AM
Bravo!

I thought the eatlier ctrl_occlusion was great and it looks like this is even better.

Thanks!

REZI-st
05-18-2006, 08:07 AM
thank you so much GOOD WORK :thumbsup:

daniel77
05-18-2006, 08:40 AM
Nice one, two thumbs up!

tryhard
05-18-2006, 09:58 AM
... where to install the dll and the spdl.

sorry, beginner in xsi


OK, I FOUND OUT BY MYSELF ...

Studev
05-18-2006, 01:34 PM
In demo002,

Do you plug the ctrl.occlusion to the diffuse-diffuse or diffuse-ambient ? I usually put the occlusion shader to the ambient. Can clarify more ?

francescaluce
05-18-2006, 03:32 PM
scenes are all downlodable. click on the demo00x
and you'll get'em on your machine ready to be tested.

about diffuse/ambient I don't care that much. what
give me the results I need it for the situation I'm dealing
with, it will get plugged. sometimes I really plug both of them.
if you're looking strict for ambient occlusion well you should
plug to the ambient slot. but doing that don't use indirect
illumination. then in the demo002 we're dealing with occlusion
used as soft shadows so it should be plugged to the color
diffuse to have a decent effect.

ciao
francesca

Studev
05-18-2006, 04:38 PM
Sorry i'm not aware that the scene is downloadable.

Thanks for clarifying. It's more noticable when u plug into the diffuse channel. Kind of like the xshading shader. Still figure out how to create reflection and transparancy.

visualboo
05-18-2006, 06:56 PM
Hi Francesca, I thought I would let you know that this shader completely jacked with one of my scenes animation. I don't fully understand why yet but if you want to know more please feel free to contact me off forum.

If you use aim or msn PM me. I also have a scene for you if you want it.

francescaluce
05-18-2006, 07:27 PM
I don't fully understand why yet but if you want to know more
me ?? :)
vis, this shader does a lot of things. what're you speaking about ?
light linking, bleeding, fg occlusion... and please post your things here
as I post mine also here just to grow up a bit this community. or next
time do it privately from the begining..
there're a couple of bugs I'm resolving but for none of that I'd use the
expression 'completely jacked ' also because we've 1k download from
the maya side and none got this kind of fatal problems. please verify
them and eventually post some example scenes. thanks for testing.

ciao
francesca

visualboo
05-18-2006, 08:26 PM
and please post your things here as I post mine also here just to grow up a bit this community. or next time do it privately from the begining..
No.

I wanted the community to know that this shader jacked a scene I was working on. Not permanently, just until I uninstalled the shader. And I wanted you to know that I'm willing to work with you and try and send you a production scene that I'm not allowed to show or post publically because of NDA crap. Of course, I could just keep my mouth shut and let you find this stuff the hard way.

Don't take what I said personally. I love the work you guys do for the community, and if you know anything about me you know that I try and help a lot too (read up in the max section... I had more free time back then).

Take care F

p.s. My offer still stands

Saturn
05-19-2006, 10:32 AM
Hi Francesca

Thanks for this great shader. I really like the occlusion path to render.

Is there a possibility to add a new feature ?
- Do not compute self occlusion of an object and compute occlusion coming from the others only.

The idea is to bake occlusion of an object as soon as you have finish the modeling. And add missing occlusion contribution of surronding object after when you place everything.

I was wondering if we can may be save some time by doing this.


Ps : I didn't have the time to test it. But I will !

benytone
05-19-2006, 02:18 PM
Grazie francescaluce:thumbsup:

francescaluce
05-19-2006, 03:17 PM
Is there a possibility to add a new feature ?
- Do not compute self occlusion of an object and compute occlusion coming from the others only.

The idea is to bake occlusion of an object as soon as you have finish the modeling. And add missing occlusion contribution of surronding object after when you place everything.Ehy, nice one. the only problem is that you'll need
anyway to probe the object, so render times will not be improved so much.
that's why till now I implemented just a way to exclude self bleeding that
instead will need some other calls and such. but you could also probe the
object and bake with more samples than those you'll use for probing the
environment, so I'll think a bit about that. thanks a lot for the feedback.

ciao
francesca

tarkovsky
05-19-2006, 11:28 PM
It's superfast! Thanks a lot, you couldn't have timed this better :)

francescaluce
05-20-2006, 01:04 AM
Hi Martin, thanks a lot for testing. :)


I upped the new v1.6b that resolves a couple of things.
download it from the first page. you can just overwrite
the .dll.

ciao
francesca

Atyss
05-20-2006, 03:21 AM
Francesca,

Let's bury the war hatchet -at least, temporily-, and talk from user to user, without regard to what might have happen in the past (surely it must be the MOBerating Squirrel syndroma). I have been experimenting with the newest installment of the shader for some time, and thought it might have profitable for everyone to let you know of my findings. I hope that you will share my will of good intentions, and understand that the comments below are totally honest and devoided of any malevolence; all these comments are meant as constructive and not to be taken as absolute.



THUMBS UP

- Nice set of controls with the environments.
- Interesting feature with directional occlusion.


PROBLEMS

- Why is rendering bent normals so much slower than standard ambient occlusion?
(0:00:01.16 for ambient occlusion, 0:00:07.70 with bent normals)

- The camera space for bent normal hanged rendering for at least 30 seconds on each occasion, giving this warning: "PHEN 0.3 warn: Cannot transform a bent normal to that space."
While I myself am a bit confused about what you could possibly do with bent normals in camera space (other than funky effects), I found that hanging to be annoying.

- The object space for bent normals has yield some surprising results. Since there were no rotations on the objects, I would have expected the object space to result in the same rendering as the world space. But I renders in a way that I can't really understand....
http://www.bernardlebel.com/img_remote/3D/XSI/WorldVsObject.png
Also, orbiting around the scene in object space always rendered relative to the camera. Perhaps I'm missing something here, but I don't see how could colors returned by normals in object space change because the camera.
EDIT: Actually..... I think the object space result is exactly what you'd expect from the camera space result. But again perhaps I'm missing something here.

- The put.in.alpha feature yields confusing results. On these next picture, the region on the left is the RGB, and the right one is the Alpha. I would have expected both to be the same...
http://www.bernardlebel.com/img_remote/3D/XSI/PutInAlphaComparison.png
I did a comparison with the XSIAmbientOcclusion shader. It takes Dark color, and puts its Alpha value in the alpha channel. I think this is more what you would expect the shader to do.

- The dinamic.ranges parameters didn't appear to do anything, despite that I was using a .map probe file. All kinds of values didn't do anything. Btw, "dinamic" should be spelled "dynamic".


IMPROVEMENTS

- Please supply proper documentation with your shaders, you have no idea how fundamental this is. Finding more or less official information on the internet is a pain in the ass.

- Many things need documentation:
-- Probe geometry: when unchecked, this turned the cube into a chunk of black blocks....
http://www.bernardlebel.com/img_remote/3D/XSI/ProbeGeometry_Unchecked.png
-- Put in Alpha: doesn't seem to do anything, even in Raw color clipping mode.
-- Normals:
--- Please describe what the Internal and Current vector spaces do.
--- Please describe what the Apply option does (other than turning the whole surface to the Base Color)
--- The Camera space didn't seem to do anything whatsoever different than internal?
--- What's the difference between the Screen and Raster Spaces?
--- What is NDC? My tests were identical to Internal and Current
-- no.self.occlusion: documenting that one would not hurt either.


OTHER SUGGESTIONS

- The ability to split the ambient occlusion from the bent normals, so both can be rendered at the same time.
- To follow with the previous suggestion.... the ability to remap the occlusion. When I worked at Meteor Studios, we had the actual ambient occlusion in the red channel, and the bent normal in the green and blue channels. Having the ability to redirect the colors into the channels of our choice would be welcome.




SHADER(S) IN STUDIO FRAMEWORKS

You have been asked several times about the availability of the shaders for Linux, and at least once or twice about the shaders to be released to the x64 platform.

So I, on behalf on legions of people blocked from using any of your shaders into studio pipelines, am asking: could you make an official statement on this critical issue? The user community will understand if this is because you don't have access to those platforms, and the community will understand as well if you can't publish the source code so it can be made by third parties. But is there any chance you can send your code to trusted people so they can compile your work on those platforms? Even my former boss (an Italian, God damn it!) tried to contact you about this with the ctrl_buffers and never got a reply.

No matter what, I think it would be time for an official statement, as I have never come accross one.



Bernard

visualboo
05-20-2006, 04:52 AM
Excellent post Bernard. Thanks for taking the time to do all of that.

Atyss
05-20-2006, 01:31 PM
Okay I think I've figured the problem with the normals. The list of items in the space menu is in fact pointing to the actual next space for the upper part of the list.

If you choose object space, you are in fact in camera space. If you choose world space, you are in fact in object space. Very simple tests can demonstrate this:

- set to object space, and rotate the object. Nothing happens. Now move the camera around, and see how the surface perpendicular to the Z axis of the camera become blue.

- set to world space. Rotate an object, see how its color "is rotated" with it (it should not).

- screen and raster spaces seem to be working normally.



Also, sometimes, switching to the Screen space makes no difference whatsoever with the previous space. Switching to Raster space changed to raster, and then switching again to screen made screen space render as it should.



Btw, the lag that I described with Camera space seem to happen in other modes as well. As I was typing this post, I switched to screen while a render was still going, and that hang happened once again, even to the point where the god damn combo stayed on top of everything!
See this picture:

http://www.bernardlebel.com/img_remote/3D/XSI/NormalMenuLag.png

(And I did not choose to write the last sentece in the image *after* noticing the persistent menu, I thought it was going to go away when I was typing the bottom sentence but it didn't, so I throught of taking a screen shot to show how powerful this hang is...)


Bernard

ProXell
05-20-2006, 02:04 PM
The Black Artifact - Is - MR artifact - not CTRL_occlusion shader miss!

Atyss - Try to search at xsibase and you'll find a lot of posts about this!

Atyss
05-20-2006, 04:02 PM
The Black Artifact - Is - MR artifact - not CTRL_occlusion shader miss!

Atyss - Try to search at xsibase and you'll find a lot of posts about this!

I'm not sure this falls into the "artefacts" category. The artefacts you are talking about, as I understand the problem (yeah, I have read all these posts) could be due -or some of them- to contrasts so high between neighbouring samples that they result in unusable data (the NaN thing). Here there is no such contrast, as I don't see how we could be out of the 8bit range with this setup. If that is indeed the problem, would it be of any use to implement some value checking&handling function in the shader?

Anway, let's see what the shader author has to say about it.



Bernard

francescaluce
05-21-2006, 03:49 AM
Ehya.

thanks for testing. :)


I don't know what's all this fuss about.

the bentnormal thing was not cleaned up. that's all.
all the 'spaces' there, were a leftover of my tests. I
simply forgot to remove them. half of them does not
make sense speaking about bentnormal, I thought it
was clear.. but I removed them to not create any
other confusion. but even there if you're in the right
spirit you could have been picked up the mr manual
and under 'Coordinate Systems', simply look what
they are referring to. no mysteries. that said a brief
note will be that 'internal' should correspond to 'world'
but as the manual says it has to be picked with a
pinch of salt, for that reason I left 'internal' along
with 'world' and 'object'. but ehy do not shot on
me if then 'internal' will be the same of 'world'.
you will see always on the manual, if you take care,
that to 'translate' a space to another there're specific
functions and if you're guessing what they do and
why and how, you can just read those few lines.

that said, the interface was passing the wrong order
so it was hard to understand.

if you have trouble with the alpha you can check the
save.to.buffer (it was prev 'apply') and you'll get a
beauty pass while the bentnormals will be saved in
the normal buffer. from the render.option->output
you can just check.. 'Normals'. and you'll get the
bentnormals saved on a separate image. (that
said, do not bother with me if you believe that
they are not antialiased.. 'coz the normal buffer
saved by xsi is '-normals'.. ie, uninterpolated. you
can use ctrl.buffer if you wanna more a beauty
kind of pass.

the put.in.alpha does work, at least here. but..
you have to check 'raw' to see it correctly. and
that should be not a surprise. read the manual
to get a brief description on the matter. that
said I see that the buildin xsi ambientocclusion
does not need it.. so I thought I could swap the
option for the time ctrl.occlusion will render the
sample but it does not work.. or better it returns
the first bucket.. well a bit weird. so I will have
to ask to those that made the mib_amb_occ and
see if they're nice enough to give me some hints.
once you'll set 'raw' you'll see correctly the alpha
but take care that's inverted.. like a shadow pass.
obviously pay attention to have not other nodes
that wil write to the alpha.. so it is useful maybe
in an occlusion pass. I will write next time somethin
that will allow to save the alpha or the occlusion
if you want in an user buffer.

the 'probe.geometry' was a bug. or better I forgot
to implement something for when it is unchecked. it should
work correctly now. so if you uncheck it under bent
normal your object bentnormals will resemble surface
normals as all point are unoccluded (if you're probing
along the normal of course), if you uncheck it under
classic occlusion.. well youl'll get no occlusion on
the object but its basecolor returned, while with env
on you'll get just the environment sampled.


so, keep on testing !! but maybe try to be a bit more
relaxed next time. as this is a freeware shader and also
a WIP. 'we're refining an advanced shader...' I started
this thread with. so take the whole thing for what it is.
and stay with me if I tell you that if I had to supply fully
working shaders I will end up probably posting exactly nothing.
that's what in general happens all the time. that said,
you should not incur anyway in any scene damage nor
your computer will explode in one billion tiny pieces.
for those brave enough to try it, a new build (v1.6c)
is available on the first page, -uninstall the previous and
install the new one.


ciao
francesca

ProXell
05-21-2006, 08:54 AM
So, as I'd make some tests - the shader is pretty good.....
Only one suggestion - to separate environment, color bleeding, default occ, and occ that simulates area shadows - the potantial is pretty good too.... And some kind of simple weight between parametrs....
I know - that it could be processed by passes - but some time, i think, it will be good to have only one pass without oversample, with more that one occ shader!

-----------------------------------------------------------------------------------------

Attys - as you can see - the problem with black dots is not about bit depth, NaN (maybe) - there are a lot of people that see such problem without any complicated render tree - And I have the problem such having you with default build in XSIocc shader - So........
I think it's XSI MR! :)

Saturn
05-21-2006, 09:43 AM
Ehy, nice one. the only problem is that you'll need
anyway to probe the object, so render times will not be improved so much.
that's why till now I implemented just a way to exclude self bleeding that
instead will need some other calls and such. but you could also probe the
object and bake with more samples than those you'll use for probing the
environment, so I'll think a bit about that. thanks a lot for the feedback.

ciao
francesca

You can maybe fire one probe ray to ask object name before entering in the sampling loop.
Maybe the call to material is slow ? because to probe with one ray is pretty fast.

But I have maybe another idea to have a boost for the performance :
Using vertex lightmap to store the occlusion contribution before to render.
Ok we will need a dense mesh to get something accurate but when you use subdivision surface ( for instance for organic modeling ) apparently XSI ( I dunno for maya ) take care of the subdivision and then send subdivided triangle to MR.
In this case we have enough vertex to get something accurate.

francescaluce
05-21-2006, 02:05 PM
Okay I think I've figured the problem with the normals. The list of items in the space menu is in fact pointing to the actual next space for the upper part of the list.

If you choose object space, you are in fact in camera space. If you choose world space, you are in fact in object space.
ehy Bernard, you're absolutely right about that.
and should be added too that the xsiambocclusion,
where we read object space is referring to camera
space. we've now internal, world(ie, same as internal),
object, camera (ie, same as object in xsiambocc).
I'm adding a new build(v1.6d) to clear up the things.
hope definitively. thanks for pointed that out.

ok I added it up, uninstall the prev and install the
new one.

ciao
francesca

Atyss
05-21-2006, 02:54 PM
>> I don't know what's all this fuss about.

What fuss are you talking about?



>> if you have trouble with the alpha you can check the
save.to.buffer (it was prev 'apply') and you'll get a
beauty pass while the bentnormals will be saved in
the normal buffer. from the render.option->output
you can just check.. 'Normals'. and you'll get the
bentnormals saved on a separate image. (that
said, do not bother with me if you believe that
they are not antialiased.. 'coz the normal buffer
saved by xsi is '-normals'.. ie, uninterpolated. you
can use ctrl.buffer if you wanna more a beauty
kind of pass.

Nice.




>> the put.in.alpha does work, at least here.

I did not say it was not working, I said it was giving out confusing results. The difference is important.




>> so, keep on testing !! but maybe try to be a bit more
relaxed next time.

I'm very relaxed, don't worry. I rarely have time to test things out, so I try to put as much as I can.



>> as this is a freeware shader and also
a WIP. 'we're refining an advanced shader...' I started
this thread with. so take the whole thing for what it is.
and stay with me if I tell you that if I had to supply fully
working shaders I will end up probably posting exactly nothing.

I never said otherwise. Not because I mean I was expecting a fully production ready freeware.



No word on my last inquiry though?



Bernard

mattMR
09-14-2006, 02:13 PM
Hello,

Is it possible to have an maya (7x, 8x) version of your last version of crtl.occlusion shader for Linux and windows ?

Thanks

francescaluce
09-14-2006, 03:30 PM
here for the maya version on windows. no linux version for this shader.
http://forums.cgsociety.org/showthread.php?t=356606





ciao
francesca

Tchicok
09-05-2007, 01:34 PM
Hi,

Why nobody talk about of this wonderfull work for a 64bits version in XSI 6.01 ?
The .dll are compile with 32bits version, so it doesn't work.
Francesca, is it possible to do something for that or somebody have information ?

Thanks

elfdestruct
09-06-2007, 05:59 PM
I assume payola is the only option. No, not here, but to Autodesk - they're all at Maya's teet.

Loolarge
02-04-2008, 06:15 PM
Hi francesca, the links for the scene files are not working anymore. Is there any chance to get hold of them?

Robbert
08-03-2008, 01:13 PM
heya...I'm testing a bit with CTRL occlusion. Great shader... I like it that you can add a direction to the occlusion.
Got a question about the settings... for some reason it works good for straight and cubic objects but I get lot's of noise with objects like cloth. Is their a way to get rid of the noise without too much rendertime? Is there a setting i am missing.
I rendered a example with pretty high settings (256 samples)... but can't get rid of the noise:
http://farm4.static.flickr.com/3014/2727310181_2905cd854e.jpg?v=0
If I render with FG occlusion i get very fast and smooth results but then the directional settings don't work.
Btw i'm using maya 2008 ext 2 x64... I tried running the 3 examples that comes with the shaders, but for some reason it gives unknown nodes for ctrl Occlusion... could it be that the examples are made with an older build for regular maya 2008 or 8.5?

CGTalk Moderation
08-03-2008, 01:13 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.