PDA

View Full Version : Point-based shaders



maxt
August 31st, 2010, 17:58
Hi there,

here first part of a set of shaders to support point-based rendering in mray:

- PCloud_Bake: generic node to bake data to point clouds.
- PCloud_Shade: generic node to read point clouds.
- PCloud_Visualizer: generic node to visualize point clouds (as points or surfels).

- PCloud_Bake_SSScattering: compute and bake SSS to point cloud.
- PCloud_SSScattering: read SSS or compute it at rendertime using point clouds as icache.

- PCloud_Bake_AOcclusion: compute and bake AO to point cloud.

Along some initial documentation, there are also demo scenes to test the shaders.

http://www.ctrlstudio.net/__shaders/PClouds_Showcase/imgs/pcloud_demoscenes.png

http://img692.imageshack.us/img692/9298/aobug000.png
http://img826.imageshack.us/img826/4430/aodemon001.png

PCloud Shaders B3 **Win64, Maya2011 only** (http://www.ctrlstudio.net/__shaders/PClouds_Showcase/Beta/PClouds_V1.0_beta03.rar)

ciao, max

maxt
September 2nd, 2010, 17:59
Sorry I just realized that the iceberg scene uses a custom shader (mix8layer) that you may find here: http://www.box.net/shared/i6hd2271qk/1/9689142/97236922

btw, you may also use any shader that is able to add together two colors (diffuseSSS+specs).

ciao, max

maxt
September 6th, 2010, 00:37
Beta2 with some bugs lifted. (first post link).

ciao, max

Remydrh
September 10th, 2010, 10:52
Continuation from:

http://forums.cgsociety.org/showthread.php?f=87&t=915427

If you need some previous discussion, look there first.

Thanks again Max!

Sagroth
September 10th, 2010, 15:27
Thanks for your development.

I've noticed that if R, G or B value of 'diffusion color' of pcloud_bake_SSScattering is equals to 1.0 - render gets black. 0,999 works though.

Enzo Catalano
September 10th, 2010, 17:31
Hey Max, nice work :-) Cool to see mr maps being put to (good) use!

Ciao!

Enzo

maxt
September 10th, 2010, 22:01
Hey Max, nice work :-) Cool to see mr maps being put to (good) use! Hi Enzo thanks, that's just the begining ! (Enzo is dev of the miMAP module).


I've noticed that if R, G or B value of 'diffusion color' of pcloud_bake_SSScattering is equals to 1.0 - render gets black. 0,999 works though.
Hi, thanks for testing.

If Albedo is one it should be clamped to 0.999 automatically. It's the mean_free_path_lenght that actually aborts the SSS computation and everything else if is 0. Take care that albedo, radius, ior are converted internally to something expected by the SSS computation, if you use extreme param values (high albedo and very low radius) you may get wrong conversions and black outputs (you should find however a line in the verbosity telling you what's going on).

Eventually, when trying to have very low SSS it's better to crank up the diffuse param instead to tweak albedo and radius, as for minimal SSS you need also a very dense pcloud or you'll start to see the construction points.

ciao, max

jb_alvarado
September 11th, 2010, 14:47
Hallo Max,
please can you export me a .mi File from the tree scene, without Geometries? I need your Settings :)

And also a another question: Can I bake Importons/IP ?

sus_gr8
September 11th, 2010, 19:57
@max
i was testing this with physical sun..
I have some questions regarding this...
When i try point clouds with physical sun without sss does it only bake fg maps?
Or does it also bake other shading information..
What if i have different objects with different shaders
do i need to create mrmap for all the different objects separately
max is there a way i can merge multiple mrmap as one map
also while generating the mrmap my cpu core temp went upto 80 C
i am using an i7 930 proc without any extreme cooling options
is it possible to bake lighting info also as an additional info on the objects
this will be useful while doing set lighting i can bake lighting info
and then just import cameras and render all the camera angles without actually
retracing lol just a thought

Remydrh
September 12th, 2010, 03:33
Max is working on implementing color bleed, reflection, more ao, etc with the point clouds. Right now there's geometry, FG, SSS. So those things can be baked for a single frame or fly-through. The rest is forthcoming.

The map is generated by whatever the shader is assigned to (you can assign more than one object like any other shader). I do not believe there is a way to merge the point clouds yet.

As for your processor temp, that's unrelated other than the fact that any rendering related activity should push your CPUs to 100% and keep them there. If you have what the manufacturer recommends for cooling, you're fine.

sus_gr8
September 12th, 2010, 05:50
@Remydrh
This shader is really shaping up nicely.. with all those wonderful features that you have stated this shader is a definite upgrade for mentalray.. Thanks to Max really !
My processor has 8 threads and while baking ideally its utilizing only 4 thread ...
I'll confirm that with a render log however they are utilized to 100 %
Probably my cities average temp is around 30 deg C and the unutilized core temp is around 46 deg C
so ideally the temperatures seem to be fine considering the ambience temp is high..

I'll post that render log.. but just wanted to know is the shader designed for 4 threads multi threading ?

jb_alvarado
September 12th, 2010, 12:01
Hello again,
I make same tests in Softimage... Is it true that I cant animate the Object that include the Point Cloud? For example: Im make a 360° rotation animation. On 0° I generate the cloud and after I render the 180° position, I get a wrong rendering, the cloud space come from the file and the and the render object get this 0° projection.

When I rotate the camera over the object the rendering is correctly.

Edit: I think motion blur also work not correct.

sus_gr8
September 12th, 2010, 14:10
Hello again,
I make same tests in Softimage... Is it true that I cant animate the Object that include the Point Cloud? For example: Im make a 360° rotation animation. On 0° I generate the cloud and after I render the 180° position, I get a wrong rendering, the cloud space come from the file and the and the render object get this 0° projection.

When I rotate the camera over the object the rendering is correctly.

Edit: I think motion blur also work not correct.

hi jb_alvarado


By default only a frame of point clouds are generated
the shader works right on that aspect
you want to render an animated pointcloud
then probably you will have to write a mel script
and then a pre render mel to replace the point cloud file per frame

jb_alvarado
September 12th, 2010, 14:31
Hello sus_gr8,
thank you, for your replay! I think its not relay a animated Point Cloud animation. Only the bounding box is animated, not the geometry.
For my test it is not so important, here I also can animate the camera. I will show you later the clip, then you see what I mean with the motion blur. Perhaps my presumption can also be wrong :).

sus_gr8
September 12th, 2010, 20:29
Hello sus_gr8,
thank you, for your replay! I think its not relay a animated Point Cloud animation. Only the bounding box is animated, not the geometry.
For my test it is not so important, here I also can animate the camera. I will show you later the clip, then you see what I mean with the motion blur. Perhaps my presumption can also be wrong :).

Yah i think visuals will anytime work
i guess as long as your objects are not moving a static point cloud will work
so camera movements are not an issue
but i think its a completely different story if baked objects are animated
because they will be out of the bb once they move around
i guess for that you may have to generate the ptcs for each animated frame.

Remydrh
September 13th, 2010, 05:21
Animated objects will need a point cloud per frame.

Static objects should be ok with one baked cloud for the animation.

I'm curious about the motion blur, it should be unaffected.

jb_alvarado
September 13th, 2010, 11:23
Yes I understand that animated Object need Point Clouds per frame. But before my idea was, that I need only 1 pcloud file, when I rotate the object.

Yesterday I render same Images with mb, and now I think they works correctly, in 1 or 2 pictures the mb looks a bit confuse...

Sorry that I have so many questions...:
Is it true that mr need more time to bake a cloud with subdivs, then with displacement?

Edit:

Here my first test, with motion blur: http://www.vimeo.com/14939155

sus_gr8
September 16th, 2010, 06:32
Yes I understand that animated Object need Point Clouds per frame. But before my idea was, that I need only 1 pcloud file, when I rotate the object.

Yesterday I render same Images with mb, and now I think they works correctly, in 1 or 2 pictures the mb looks a bit confuse...

Sorry that I have so many questions...:
Is it true that mr need more time to bake a cloud with subdivs, then with displacement?

Edit:

Here my first test, with motion blur: http://www.vimeo.com/14939155

@ jb in vimeo link you have stated that Rendertime without baking ~32 second per frame.
what are the render times with baking ?

jb_alvarado
September 16th, 2010, 12:04
I only bake the first frame, but I don't capture the time for this. I think it was ~50min. At the moment I have a bit problems to get a good balance from the displacement details to the baking time.

Remydrh
September 17th, 2010, 20:07
I'm having some unfun with getting occlusion to work. Is there a test file for that?

Also, is it a major pain to also include reflection occlusion? I don't really need glossy. . .yet.

(I'm a pushy broad aren't I?)

sus_gr8
September 18th, 2010, 23:03
I'm having some unfun with getting occlusion to work. Is there a test file for that?

Also, is it a major pain to also include reflection occlusion? I don't really need glossy. . .yet.

(I'm a pushy broad aren't I?)

Unfun ? are you not getting the right occ spread ?
are the point based occ rendering out as bloches ?

Remydrh
September 19th, 2010, 08:12
Looks like it's not working at all. Already subdivided it a ton.

sus_gr8
September 19th, 2010, 08:40
did you subdivide it using a displacement node ?
because even I think it needs a lot of subdivisional values to work
I tried it on a cube and I had to displace it like to 8 UV values...
Btw where's max looks like he is busy adding some more parameters lol

Remydrh
September 20th, 2010, 08:30
I'm making a wrong connection somewhere apparently.

What sample shader are you using?

Remydrh
September 20th, 2010, 09:20
Nevermind. I'm sort of an idiot. Got it figured out.

I ended up over compensating later and generated way too many triangles but it works now. So I can use this for some raytraced effects for now. Hoping for the faster versions later.

I have faith.

maxt
September 21st, 2010, 12:06
I only bake the first frame, but I don't capture the time for this. I think it was ~50min. At the moment I have a bit problems to get a good balance from the displacement details to the baking time.

That's because you need to tweak the 'Pre-Bake FG'.
If you have let's say micropoly displacement.. you can't put a FG icache point at every tri or vertex.. because you would end up having sub-pixel irradiance cache .. that's really a too much dense FG cache and baking time will be huge ! Try starting with at 32vtx, then go up until you start to see some artifacts. Here baking milions of polys with FG take just a bunch of mins. Btw, thanks for the test scene !! :razz:


In the while I've upped Beta3 with point-based ambient occlusion.
Didn't have time to add docs but there're the following scenes included with the drop that should get you started.

http://img709.imageshack.us/img709/2159/pcloudaocornellbox.png

http://img163.imageshack.us/img163/9292/pcloudaodemonhead.png
I see rightnow I left the AO tolerance way too high and there's some kinf of 'banding' artifacts (e.g. neck base).. you may want to low that down to 0.2 or lower to get rid of those.

Eventually, take care that point-base AO is 'output insensitive'.. it will take the same time getting AO from a 640x480 or at HD1080p. On HD outputs it's 2x faster than raytraced AO (considering one bakes out the whole model and not only the view).

ciao, max

Remydrh
September 21st, 2010, 22:25
Works great!

Only caveat I have is that I have a hard time keeping it from being too dirty in an interior. Like the cornell box, it seems to be overall grey despite some tweaking.

Remydrh
September 22nd, 2010, 19:08
Memory Management.

While baking AO I turned off all raytracing effects. I assumed it wouldn't call any anyway.

I grabbed the old Evermotion Classroom scene and decided to bake it.

I ran out of memory on a 4GB RAM machine after a few attempts to flush.


MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : try '-memory 2400' for future runs
MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : ================ memory error post-mortem ================
MEM 0.3 info : -------- memory summary --------
MEM 0.3 info : module max MB curr MB %bytes
MEM 0.3 info : MSG 7 7 0.30
MEM 0.3 info : MEM 48 0 0.03
MEM 0.3 info : DB 2333 2332 95.80
MEM 0.3 info : PHEN 207 0 0.02
MEM 0.3 info : RC 14 0 0.01
MEM 0.3 info : GAPMI 31140 56 2.30
MEM 0.3 info : RCLM 742 0 0.00
MEM 0.3 info : JOB 12 18 0.77
MEM 0.3 info : GEOMI 1 0 0.00
MEM 0.3 info : LIB 6 2 0.09
MEM 0.3 info : RCI 3 0 0.00
MEM 0.3 info : DBN 59 12 0.51
MEM 0.3 info : RMSL 4 4 0.16
MEM 0.3 info : other 4 -0.00
MEM 0.3 info :
MEM 0.3 info : total 2435 100.00
MEM 0.3 info :
MEM 0.3 info : max heap memory approx. 2484 MB, now approx. 2481 MB
MEM 0.3 info : -------- database summary --------
DB 0.3 info : database elements by module:
DB 0.3 info : jobs MB #jobs MB #nonjobs module
DB 0.3 info : 0 0 2 1 NULL
DB 0.3 info : 2319 21573 0 0 GAPMI
DB 0.3 info : 0 1636 3 22352 DBN
DB 0.3 info :
DB 0.3 info : database elements by type:
DB 0.3 info : jobs MB #jobs MB #nonjobs type
DB 0.3 info : 2318 20755 2 2 40 nbox
DB 0.3 info : 1 818 0 0 42 splitobject
DB 0.3 info : 0 1636 4 23170 63 serializable
DB 0.3 info : 0 20758 1 8068 other
DB 0.3 info :
DB 0.3 info : 2319 43967 8 31240 total
MEM 0.3 info : run with '-message mem debug --' for more info.
MEM 0.3 info : please try lower -memory settings.
mental ray: out of memory


Should I be more aggressive with lowering the memory limit or should the point baking drop triangles more often? I had triangle visibility unchecked. I tried checking it and lowering the memory threshold and now I get a fatal crash.

sus_gr8
September 23rd, 2010, 06:40
Memory Management.

While baking AO I turned off all raytracing effects. I assumed it wouldn't call any anyway.

I grabbed the old Evermotion Classroom scene and decided to bake it.

I ran out of memory on a 4GB RAM machine after a few attempts to flush.


MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : try '-memory 2400' for future runs
MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : allocation of 3078216 bytes failed: flushing
MEM 0.3 info : ================ memory error post-mortem ================
MEM 0.3 info : -------- memory summary --------
MEM 0.3 info : module max MB curr MB %bytes
MEM 0.3 info : MSG 7 7 0.30
MEM 0.3 info : MEM 48 0 0.03
MEM 0.3 info : DB 2333 2332 95.80
MEM 0.3 info : PHEN 207 0 0.02
MEM 0.3 info : RC 14 0 0.01
MEM 0.3 info : GAPMI 31140 56 2.30
MEM 0.3 info : RCLM 742 0 0.00
MEM 0.3 info : JOB 12 18 0.77
MEM 0.3 info : GEOMI 1 0 0.00
MEM 0.3 info : LIB 6 2 0.09
MEM 0.3 info : RCI 3 0 0.00
MEM 0.3 info : DBN 59 12 0.51
MEM 0.3 info : RMSL 4 4 0.16
MEM 0.3 info : other 4 -0.00
MEM 0.3 info :
MEM 0.3 info : total 2435 100.00
MEM 0.3 info :
MEM 0.3 info : max heap memory approx. 2484 MB, now approx. 2481 MB
MEM 0.3 info : -------- database summary --------
DB 0.3 info : database elements by module:
DB 0.3 info : jobs MB #jobs MB #nonjobs module
DB 0.3 info : 0 0 2 1 NULL
DB 0.3 info : 2319 21573 0 0 GAPMI
DB 0.3 info : 0 1636 3 22352 DBN
DB 0.3 info :
DB 0.3 info : database elements by type:
DB 0.3 info : jobs MB #jobs MB #nonjobs type
DB 0.3 info : 2318 20755 2 2 40 nbox
DB 0.3 info : 1 818 0 0 42 splitobject
DB 0.3 info : 0 1636 4 23170 63 serializable
DB 0.3 info : 0 20758 1 8068 other
DB 0.3 info :
DB 0.3 info : 2319 43967 8 31240 total
MEM 0.3 info : run with '-message mem debug --' for more info.
MEM 0.3 info : please try lower -memory settings.
mental ray: out of memory


Should I be more aggressive with lowering the memory limit or should the point baking drop triangles more often? I had triangle visibility unchecked. I tried checking it and lowering the memory threshold and now I get a fatal crash.


HI
Remydrh
Can you post the scene file ..
Ill try the same on a 4 gb ddr3 ram ..

Regards

Remydrh
September 23rd, 2010, 09:03
Now crashes pretty fast even on a machine with a lot more ram. :-(

moulder6
September 25th, 2010, 17:37
Hi, guys! Great things happening here! Max has done hell of a great job!

I am using 3ds max and i menaged to try them all n should say that besides the lack of descent interface, everything is working smoothly and great! Though i have to point out a few things... or let's call them issues:

First of all in order to get proper baking one need to assign a irradiance shader but as u can assume conecting a max or even mr material doesn't work... what i did, though was unhiding some of the illumination shaders in base.mi (blinn, phong, etc) so i was able to connect them and get the shading... i tried to use the material to shader node, in order to use mia_material_x or sumthing else as a irradiance shader, and though it's successfully conected it returns error message: material to shader called with unknown tag... (or sumthing like it)

Another issue would be that neither of the point based shaders have respsect for the physical scale, physical units of mr_photographic, which i used with mr_sun&sky. as soon as it's turned on everything renders black... a workaround would be to set the mode to unitless, and give it value of ~90000, and this way it does work!

What i'd like to ask is if there could possibly be some sorta intorpolation for the pcloud itself, to smooth out the solution, compensating for low density (low subdivision) coz on a real production subdividing everything enough to get the proper smooth light distribution and sss would over with constant crashing while trying to bake everything.
and i should say that it would be nice to get this working with Irradiance particles, as an option, beside FG :)

sus_gr8
September 25th, 2010, 19:17
@ Max

M facing one problem with baking ao ..
While I am saving the mrmap of AO I can do it in any directory thats fine..
But when I tend to save it in a folder in project directory (eg textures folder in the maya project )
maya by default takes the path as textures\ao.mrmap instead of the complete texture path...
So while writing the mrmap it doesnt understand where to write the map and it gives an error with the map generation process.
However it works file when I am not saving the map in the current maya project folder.

sus_gr8
September 27th, 2010, 14:07
Hi, guys! Great things happening here! Max has done hell of a great job!

I am using 3ds max and i menaged to try them all n should say that besides the lack of descent interface, everything is working smoothly and great! Though i have to point out a few things... or let's call them issues:

First of all in order to get proper baking one need to assign a irradiance shader but as u can assume conecting a max or even mr material doesn't work... what i did, though was unhiding some of the illumination shaders in base.mi (blinn, phong, etc) so i was able to connect them and get the shading... i tried to use the material to shader node, in order to use mia_material_x or sumthing else as a irradiance shader, and though it's successfully conected it returns error message: material to shader called with unknown tag... (or sumthing like it)

Another issue would be that neither of the point based shaders have respsect for the physical scale, physical units of mr_photographic, which i used with mr_sun&sky. as soon as it's turned on everything renders black... a workaround would be to set the mode to unitless, and give it value of ~90000, and this way it does work!

What i'd like to ask is if there could possibly be some sorta intorpolation for the pcloud itself, to smooth out the solution, compensating for low density (low subdivision) coz on a real production subdividing everything enough to get the proper smooth light distribution and sss would over with constant crashing while trying to bake everything.
and i should say that it would be nice to get this working with Irradiance particles, as an option, beside FG :)

@ moulder

We all would love to see this shader working with a lot of options available in the 3d software..
however its still in the beta testing phase and new things are getting added up as the shader is stabilizing.
It wont be long before all your wishes come true lol

I dono anything about 3dmax but as per the docs you cant use maya shaders as this shader supports only mentalray shaders ... Actually maya crashes if we use maya shaders dono about 3dmax shaders though..
as per you post can you also let this forum know what error is 3dmax throwing at you so that someone can help u out here...

moulder6
September 27th, 2010, 20:25
@sus_gr8 - thank u for ur attention! I should say that i am pretty aware of all u say! I read trough all the stuff published here n at CGSociety so i am acquainted with it. But as u said, it's a beta testing phase, so i guess every little problem n detail would be of use to Max as he develops it further :)

The problem i got with "material to shader node" is because it's not native to mental ray, but rather 3ds max specific, so i guess it's not supported yet (as every feature that is not native for mray). But there's no other option for me to use any other material in the "sample shader" slot, other than connecting is trough the mentioned above node. So i can't even connect Arch&Design material (called mia_material_x in maya's interface) which is native to mray. Still max don't crash when u have it conected this way:
mia_material (or anything else) => material to shader => Pcloud_bake (sample shader) but here's what i got as an error message:
"PHEN 0.3 error: Shader 'max_MaterialToShader' called with unsupported call type"
and the geometry rendered flat white...
when i use, though, some of the hidden illumination shaders (which r not hidden in maya - mib_illum_blin, mib_illum_phong, etc.). i can connect them directly to the "sample shader" slot, without using "material to shader" node, and everything works perfect.

The other thing about interpolation would be definitely sumthing nice, coz i already got dozen of crashes as soon as i subdivide my geometry to get some more details. n i know interpolation won't be useful for baking a detailed texture map, but would be pretty helpful when u bake colour or lighting.

A solution for ur problem would be to make ur project use absolute instead of relative paths.

jb_alvarado
September 28th, 2010, 14:40
You dont need a material to shader node. All shader what you need, you can unhidden. For example the mia_material_x you find it in the architectural_max.mi

moulder6
September 28th, 2010, 16:35
@jb_alvarado:
Thanks, i have obviously missed that the GUI is actually hidden in architectural_max.mi i was looking for it in the architectural.mi :)

moulder6
October 1st, 2010, 22:22
Here, guys i have attached a .mi file for all the 3ds max freaks like me :) it's just a phenomenons giving u a descent interface n default values to work with, with respect to the UI n default values that Max has set for maya users.

@Max - hope u'll forgive me for being in a rush! Thank u for the wonderful job u'r doing for the community!

instalation: copy it in the same folders as ctrl_PCloud.mi but don't erase the old one. n u'll get the same shaders with the same name n functions but in the UI these one start with "max".

Farins
October 4th, 2010, 18:05
i have install thas nice shader on my 3ds max 2011 x64....but miss something....

in my shader list i have

Pcloud_sss
Pcloud_shade
Pcloud_visualizer

but miss Pcloud_bake....i dont have find it...where?

moulder6
October 5th, 2010, 22:45
In case u have installed only the original ctrl_PCloud.mi, written by Max, there must 3 more:

Pcloud_bake
Pcloud_bake_ssscatering
Pcloud_bake_aocclusion

in case u have installed ctrl_PCloud_max.mi (if so u should have the original ctrl_PCloud.mi installed as well) u should have 6 more:

max PCloud SSScattering
max PCloud Shade
max PCloud Visualizer
max PCloud Bake
max PCloud Bake SSScattering
max PCloud Bake AO

under letter "m" in the maps list :)

Farins
October 6th, 2010, 16:58
mmmm i have follow your install instrucition...

i have leave the Max original .ini file and i have put the other .mi file in the same folder...but nothing...

look my screen:

http://img835.imageshack.us/img835/3278/problema.gif (http://img835.imageshack.us/i/problema.gif/) Uploaded with ImageShack.us (http://imageshack.us)

moulder6
October 6th, 2010, 17:19
I guess this .ini u'r talking about refers to the original ctrl_PCloud.mi?
where did u open from that material/map browser? in case it is directly from the MR Material Surface shader slot, u won't be able to see them coz all the PCloud Bake shaders r signed as lightmaps... So it's the lightmap slot where u should look for them... Or even try opening the Slate Material Editor n look in the material/map browser there for it's showing all of the available maps, no matter of their type.
http://img685.imageshack.us/img685/4707/maxpcloud.th.png (http://img685.imageshack.us/i/maxpcloud.png/)

Farins
October 6th, 2010, 17:35
moulder6 you have right!! in the max 2011 you cant see that shader in old compact material editor...i have find it just in the slate material editor....thank you, now i can test this shader :):)

RobPhoboS
May 12th, 2011, 17:18
Seriously cool work, just wondering what has been happening with this since Oct last year ?

maxt
May 13th, 2011, 20:41
Seriously cool work, just wondering what has been happening with this since Oct last year ? ehy, thanks ! in the while I've added a raytracer module to get points data from the camera instead to go for geo tesselations. however that wasn't working cool because of the unknow point size, so I had to introduce some sort of 'locality' for points, and to do that I had to implement morton ordering and k-nearest-neighbor stuff. but at that point I wasn't happy with the overall times, so I started working on a CUDA implementation. With some luck I may be able to post it in a near future in a first standalone version for testing.

cheers, max

Remydrh
May 14th, 2011, 02:05
Most excellent! Looking forward to it!

Would be great if a few of these experiments solidified into a solution that could be integrated by AD. I miss point based approaches from Renderman.

But not much else. :-)

maxt
January 3rd, 2012, 06:45
< experimental point based final gathering >

first image is direct lighting, which is baked into a point cloud.
second image is the point based global illumination test.
third image is build-in factory mi final gathering for comparison.

you recognize it from the infamous splotches on the ceil and near the main bright shadow areas under the bunny :) , mi_fg tends also to produce unnatural silhouettes at very incident surface angles in penumbra (ie. under bunny neck).

maxt
January 4th, 2012, 05:16
< point based IBL >

direct light,
straight render,
tonemap

rawalanche
January 4th, 2012, 15:25
Any chance of getting my dirty little paws on this? I would love to test anything GI related... :)

Kzin
January 4th, 2012, 18:51
i agree with rawalanche, looks interesting. point based ibl could be really helpful. how does it looks compared to mr's ibl shader? is it also possible to render accurate ibl lighting or does the indirect shadowing render like an interpolated method like fg (ibl is a direct light, i know, so the shadows of an hdri are great in detail/quality, but how does point based will look)?

maxt
January 5th, 2012, 07:11
there ain't any interpolation here, this is hierarchical light gathering. Provided you have enough points in the cloud and that you set an high enough solidangle tolerance you won't have any defect (aka splotches or flickering).

< one bounce pure IBL point based final gathering, 1K, 5M points, 2mins >

Remydrh
January 6th, 2012, 02:52
Can I assume this means you solved the problem with generating enough points?

I know it's basically for free in Reyes but a raytracer is a different animal of course.

This is something I know was asked of Autodesk awhile back. Is this purely your implementation on the side? To my knowledge there hasn't been a lot of internal (Autodesk) resources to developing or integrating features for Maya in some time.

I would love if you could help that along because some tools built for Maya users would be great. Max seems to get most of the love lately.

maxt
January 6th, 2012, 07:33
Ehy Remydrh, how's going ? btw never assume anything !

< simple test >

Remydrh
January 6th, 2012, 08:01
Well, I have some complex models and CAD data, etc I would love to test this on. Dense to not-so-dense parts next to one another.

So even if you haven't solved the problem, maybe we can see how close you've come. ;)

rawalanche
January 6th, 2012, 12:03
Alright. Once again, last attempt. Can i test it? :)

maxt
January 18th, 2012, 07:52
Can I assume this means you solved the problem with generating enough points?look the only solution is an enhanced workflow, I'll end up adding various ways to be able to splat models for point rendering, one may choose the best splatting based on models or the entire scene, dependeing also on the point cloud method, static (pre-baked) or refined at shading time. implementation is transparent, point cloud finalgathering is actually a simple shader in the rendertree, any effect or existing shader is welcome.

maxt
January 19th, 2012, 06:02
a couple more testing pointbased IBL, unifiedsampling and DOF, crazy textures and UVs but the effect seems there (drag to desktop for HQ)

maxt
January 20th, 2012, 09:18
last one ! ;)
(while optimizing and benchmarking sse)

rlevene
January 20th, 2012, 22:16
really love the quality of these shots and the way you have the muddy snow areas come through in the first couple of renders.

amazing work with these shaders as well.

best,

richard

mythravarun
January 23rd, 2012, 14:05
The whole post running from Aug 2010 finally looked to give promising feature. Can some one send me links where can the recent downloads of these for maya can be found? I tried downloading the first download in the starting of the post. Couldn't visualise pointclouds. It was crashing. May be my procedure was wrong. Is there better docs on these stuff ?

mythravarun
January 24th, 2012, 06:25
From the links provided at the starting of the post I could download Beta 3. I guess its the recent one.

I tested baking and shading using the above tools. Its working. But I would like to know how it can be used in a way thats used in PRMan Pipeline, to bake light, occ, refl, FG and IBL in MRMaps and render that along with tex for each mesh ?

Remydrh
January 24th, 2012, 06:40
I don't think Max has updated those packages. Can you verify that Max?

maxt
February 1st, 2012, 06:19
Hi, I re-wrote almost everything from scratch (SSS and AO are 30/40% faster.. sse, paranoid cache-conscious data layouts and templates did the most work) and for the time I have I think I'm not gonna support old stuff sorry.

Some other tests.. that being addicted to NeedForSpeed(Shift2) I had to render at least some HQ stuff to giustify all the time spent there ;) Interesting here mray fg is side by side with pbased fg, in fact glasses and everything behind is mray fg, everything else for the IBL lighting is pointbased stuff (there's only two pointclouds, one for the scene which doesn't need to bake any color data(ie. no direct light) and one for the dome with its albedo baked in), reflections and such are plain mia_mats. One may even bake a first usual fg pass and then use pointbased fg to refine it, ie. a combination of irradiance caching for a first rough pass and then hierarchial gathering for the final one (open in another win or drag to desktop for hq).

maxt
February 9th, 2012, 03:57
here a cheap screencast demoing interactive highquality AO. I first bake the pcloud and then interactively tweak the view and ao params.

for those interested, ao is computed at shading time and full data structures are built at every run, data structure generation is an order of magnitude faster than before, plus I just found (still to be implemented) a funny way to 'linearize' them, which should bring good chances for both out-of-core and cuda support.

http://screencast.com/t/aH2nNEZZVeCX

Remydrh
February 9th, 2012, 06:46
I love this. You work for AD, integrate it?!

maxt
February 9th, 2012, 14:40
I had no contracts with adsk for 2011 and that's why I had some time to dev this. ;)
Btw if/when I bypass some main tech obstacles I may need an 'editor/publisher' (kinda a product manager) for the plugin and I was thinking at you.

Kzin
February 9th, 2012, 14:59
it would be great to have a xsi version of the shader if you plan to release it. ;)

maxt
February 9th, 2012, 15:22
of course softimage is still my beloved dcc

Remydrh
February 9th, 2012, 18:43
Depends on how you'd like to handle their release, support, etc. I can see these being very valuable for production in a few places where we can mix the abilities of Unified and some pre-baking at the same time.

I think the landscape is most interested in what can be done for indirect lighting.

maxt
February 9th, 2012, 21:06
yep, that's the idea. anyway here a cheap screencast also for SSS. take care the first frame take 0:38 considering also glossy reflections and FG (baked), the remaining SSS tweaking is interactive (stuff is a bit steppy due to screen rec). cheers.

http://screencast.com/t/WegxFypguEB

http://screencast.com/t/UPpbwpBVPnPe
http://screencast.com/t/NKEj0qv8U5

RGhost77
February 10th, 2012, 12:58
I wonder, can be benefits of using such shader in stereoscopic render?

Remydrh
February 10th, 2012, 15:18
You should be able to re-use the data between each eye in stereo without recalculation.

FG right now is done by a center camera and is once for both eyes but point based should prove to be more stable over an animation if implemented correctly.

SSS etc could also be done once per stereo pair.

rlevene
February 12th, 2012, 11:14
hi max,

with the point baking, is it computing the whole surface or what is just seen through the camera? if the object was close up in first frame and the turned and moved away from camera, would this require an animated bake of the point cloud?

or can just bake the point cloud once in one frame from any camera and it will then be perfectly reusable for any camera angle/object position?

cheers,

rich

maxt
February 12th, 2012, 19:53
hi richard,

that depends by what you're baking and more generally how a pointbased workflow is managing your maps. for example if you bake direct illuminatioin with shadows, you need of course to re-bake stuff involved in the animation. however there're certain cases where you may need to re-bake only the pointcloud for the animated objects. think about IBL, you don't have any direct light and any map is independent from any others so you may end up re-baking only the animated stuff. the GI shader node can lookup multiple maps onthefly and start assembling from there a whole new pcloud and data structs to support it.

max

maxt
March 1st, 2012, 22:26
here as mentioned above I'm testing, mray FG for the first bounce, and pointbased light gathering for the second and final one, which maybe a very interesting approach for this kind of scene. in fact it seems simple but both fg and pbased stuff may have problems to render it out easily, for the former because of the hdr range, for the latter because of the 'directional' lighting. so I use them both. :)

thing is that FG is a two step approach, formerly it's called lazy irradiance evaluation, an initial 'lazy' step where irradiance samples are placed onto the scene(here at 1/128 vertx ratio), then for each point on a surface we evaluate irradiance, if the cache (the lazy samples) contains any valid entries interpolate between them, if not get a new irradiance entry; the main problems are that we get back a blotchy solution, or an un-detailed one, or something that will take forever to render. so I use the irrradiance caching to store a first rough light bounce and pointbased light gathering to smooth it out, where I can keep the cuberaster at low resolution (for a faster render) as I have a more evenly lighted scene. final result time (3mins 45secs) has both fg and pbased evaluated. for the same time a 2 bounce FG would have still very poor quality.

maxt
March 2nd, 2012, 02:52
here the 2 bounces mray FG for comparisons under the same amount of time(480rays, 2 for density and 12 for interpolation). Looking at the results I think we're an order of magnitude faster than plain mray FG as it would require bruteforce to get to the same quality (if anyone has time to test that I can pass you the scene ;) ).

maxt
March 2nd, 2012, 03:47
here instead the same tecnique as above (mrayFG+pbasedFG) where I increase the cube raster to 24 pixel resolution and the solidangle tolerance to 0.05 to get rid of some 'streaks' you may have noted on the wall under the left soldier arm.

just take care that this is still not SSEnhanced as I still have to integrate the full sse code for mentalray (ie. sse working only for pre-baked standalone pbgi ), and being too tired to start rightnow.. that's why I keep rendering queer stuff ;).

for simple scenes like this one with a pointcloud of around 5M points (edit: of course being almost at pixel resolution that amount of points would suffice also for displacement or some added complexity) I'm generally able to render at 1K resolution. in-core memory consumption is around 500MB for the whole pointbased stuff. cheers.

Kzin
March 2nd, 2012, 10:44
looks great!
i like the detailed shadowing of the solution. compared to fg its way faster.
it also shows whats wrong with fg and that could be improved in general for this method.
cant wait to use these shaders.

maxt
May 8th, 2012, 18:23
ehy just to keep the thread alive, nothing fancy, a 'point tessellator' based on REYES split&dice.

on the camera facing triangle you may recognize three main (bilinear) patches (basically four sides polys) which are then subdivided into microgrids, the little points are the vertex micropolygon after the microgrid has been diced.

in the REYES pipeline it is there (on the micropoly vtxs) that are computed dUdV, applied discplacement and finally passed to the shading grid that will take care of sampling (before that may have been happen the hiding pass). take care you can see the subds because I render the micropolys border too (which won't happen in practice), you can see also how the tessellator is view dependant looking at point density.

for our point renderer we'll stop just at this stage getting the centroid of the micropoly and its radius and go straight to bake stuff. using the reyes approach for the point generation will give in turn the same pixel resolution to a pointcloud there's in prman. the point generation itself is fully sse compliant (a patch is a transposed 4(sse vector)*3 matrix actually) and it takes 'micro seconds' to happen (in the lightmapping pass).

Remydrh
May 8th, 2012, 18:44
Out of curiosity (and practicality) are you avoiding anything that might make this hard to use later because it is based on something Pixar owns? Everyone is litigation happy nowadays.

maxt
May 8th, 2012, 19:35
I don't think anything about REYES is patented (probably mainly because if was 1987) also originally it has been proposed as a worldwide standard to adopt for 3d.

Remydrh
May 8th, 2012, 21:03
Reyes itself possibly isn't (I think 20 years is the limit anyway.) But some of what gets built into it can be (shaders etc). Just wanted to be sure since you're making it a product at some point (hopefully).

maxt
May 9th, 2012, 01:19
beside patents infringments (which ain't a problem here) is interesting to note that everything that belongs to REYES regarding shading is the classic shading pipeline build on a SIMD architecture ( those dUdV which come with microgrids that are used for bump eval, texture filtering, procedurals antialiasing and so on) which is not available in mray (derivatives are sometime computed by the host application and saved into vertex data, don't know about recent ray differentials, or last 3.10 additions..). well nothing of that is necessary for point based SSS,AO,GI but I have already all of that available for point clouds in general and as soon if ever I have a consitent caching system implemented (to kinda simulate what in prman is the bucketing caching scheme) I'll see if it will make sense to add some more output to the various point based nodes, ie. along with SSS AO GI a node would be able to output for example derivatives for the shading point to be used in hypershade rendertree slate whatever.

Remydrh
May 9th, 2012, 05:05
I prefer Hypershade concentration, sure that'll make someone groan. . .

maxt
May 13th, 2012, 04:31
ehy, here some better point splatting. because of course reyes prefers patches/polygons more than triangles (in fact there isn't even a 'triangle' primitive in reyes) and being all the modelling done in a poly fashion, while in lightmapping phase we have available just the triangulated mesh, most of the triangles patched as three polys (as in the prev approach) were badly stretching all the micropolygons.

so I implemented a fourth phantom vertex method to patch the triangle. we simply add a fourth dummy vertex (opposed to hypotenuse, becuase the hypotenuse is generally the line 'cut' for the original poly in two tris) to treat the triangle as a parallelogram and then deal with that while split&dice. if we split the resulting patch in UV the upper right patch can be excluded, while the other two interested by the phantom vertex will have their U+V > 1 part excluded from splatting while in the dicing phase. you see the point cloud doesn't look like being made from triangles (ie. the cube once in mray is actually a twelve triangles, not a 6 poly faces, but that looks like the latter looking at the point cloud). cheers.


// C D=(B-A)+C
// ......
// |\ .
// |+\ .
// |++\ .
// |+++\.
// ------
// A B

maxt
May 18th, 2012, 04:38
some ao tests with the new point engine

maxt
May 25th, 2012, 04:44
almost there with the point generator. here some tests with GI. around 5M points (less than one gig ram). a bunch of secs for baking. around 3mins each render. multiple views are from the same point cloud. the model found on the www eventually has all sort of bad modelling ie. streched triangles, intersecting geometry, one side polies and so on, - a good testbed for point generation. (right click and select 'open in a new win/tab' for full size)

Remydrh
May 25th, 2012, 05:43
Looks a little strange around the cockpit windows but otherwise nice. Are you keeping this where it can be pre-baked and then just rendered? (bake only, then render for instance)

maxt
May 25th, 2012, 06:05
you can bake GI into the pcloud but that would generally just to bake a first light bounce and then render out a second one. using directly the pcloud for some final quality render would require subpixel density and thus milions and milions of points without reaching anyway what you get in a bunch of mins. cheers.

edit, the cockpit is really just some bad modelling

maxt
May 25th, 2012, 20:52
some better support for CAD style modelling where poly detail is sparse, the splatter engine can be set to half the resolution with an enhanced pixel dicing to better catch pixel-size triangles. pclouds around 3M (half giga ram), 800x800, 3/4 mins. these are dev scenes for test, gamma and general illumination are left to default to better catch details. open in new win for full size. edit: banding comes from web.

Remydrh
May 25th, 2012, 21:30
How well does this handle an HDR with a very high value hotspot? I assume pretty well. We have this issue pretty constantly. An RGB value of 4000-8000 for instance.

I would love to be able to generate a cloud once for these images and re-use since many times we just have a high resolution still to generate.

maxt
May 25th, 2012, 23:11
HDR is supported, however very highly 'directional' illumination is not so cool for the point rasterizer atm, it tends to render light leaks in-between surfels and to reproduce 'steps' between hierarchical levels (ie. big rounded chunks). you can still mimic the sun with a directional light however (or you can bake an IBL area light, didn't try that), the problem is when the HDR is the only illumination source (and for that only 'pathtracers' can fullfill your kind of request anyway, which is at the end looking for physical correctness, or at least is better managed in that domain of things). eventually I plan to add importance sampling and spherical harmonics asap and that should fix the problem at the source, or I can see to implement lightcuts as a pre-pass first light bounce where on that apply the final gathering, but first I'd wanna finish the splatter engine and maybe start some internal beta testing.

maxt
May 25th, 2012, 23:26
I mean something like this. 'directional' illumination can be rendered with the pcloud rasterizer but it has to come from 'direct' lighting, here for example I bake a default area light and on that apply a first bounce pbgi. as always, open in new win for full size.

maxt
May 27th, 2012, 21:34
just to add some color to this thread ;-)

1K images, 5M points, 12px cube raster, 0.05 solidangle, 6mins

Remydrh
May 28th, 2012, 19:29
Nice. What do the controls look like right now? Are you going to keep the controls down to a minimum? Maybe you could post some of that and we could look at how it works and maybe refine it for a production setup.

mythravarun
July 25th, 2012, 14:47
Does this work for maya 2013. I have tried with beta 3 and its not working. So is it available for 2013 ?

maxt
August 13th, 2012, 17:54
ehy sorry, some forced holidays, for the past months we got more earthquakes in northern italy than ie. in CA; interesting earthquakes under some aspects are treated as an n-body problem, I believe that one of the first octree implementation (which is often used in PBGI approaches) comes from geology. :twisted:

eventually I'm looking for testers (half a dozen may be enough) to begin some betatesting in a couple of weeks or so, you'll test mainly the splatter engine and the PBGI implementations. I'm looking for ppz with high-end machines (win64, i7, 16GB+, maya2012/2013) and skills that do not need to be trained to be able to use the shaders ( you'll get some basic intro and test scenes ). a couple of lines as intro to yourself or references if I don't know you, would be welcome.

cheers