Houdini 12.5 geometry light point clouds

   11637   8   0
User Avatar
Member
48 posts
Joined: June 2011
Offline
I'm trying to make use of the new point cloud feature for geometry lights in Houdini 12.5, but there's a few too many unexplained quirks and details for me to get my head around. Can anyone explain how it works behind the scenes?

Firstly, it seems that when I specify a geometry node (in this case a fog volume), it will generate a point cloud fine. Then I tell it not to auto-generate, and read the pre-baked pointcloud from disk. This works fine too, but if I then remove the reference to the original geometry, and use the pointcloud exclusively, it will emit light with a darker patch near the object itself. I would assume if point clouds were being used, it would skip normal geometry lighting entirely, but it appears to combine both together.

Secondly, I've been loading the point cloud back in, and looking at the contents. The attributes that appear to contribute are “A” “weight” and “volume”. I'm guessing volume is a representation of the physical size of each point in the cloud. I'm not clear on exactly what effect A and weight have. I can't seem to work out in either case how the numbers correlate with the values in the volume they were generated from. There doesn't appear to be any attribute in the generated point cloud which actually holds information about the volume densities/values it was generated from - not even position, as they're arranged in regular axis-aligned grids, rather than having more points for higher density.

This lead to an interesting test - I was testing out how different volume values altered the values generated in the point cloud - I would presume more light would be emitted from higher values, but it actually appears to emit uniform light from all non-zero points in the volume.

I tested it with a volume which had a constant density of 1.0 in a cylinder around the y-axis. I then made the same cylinder with a linear falloff from 1.0 at the axis, to 0.0 at the edge of the cylinder, and it emitted identical light onto the plane I had placed just below it. If I make the value a constant 0.001 instead, it emits exactly the same again.

Is there a glitch in here?


I'm trying to get to the point where I can generate my own custom point cloud to light with, but I just can't work out how the point attributes relate to the lighting. “A” and “weight” both seem to have similar, but different effects.

Oh, not sure if it matters, but this was all done using “Physically Correct” light attenuation.
User Avatar
Member
1002 posts
Joined: July 2005
Offline
For your first question, the point cloud mode on the geometry light is currently built to work using both the geometry and points via multiple importance sampling. This is what is used with PBR and in the surface model VOP, and helps to produce a low noise level regardless of whether you're shading points that are close to or far from the emitting geometry. With multiple importance sampling, it will tend to prefer using the geometry when shading close to the emitting object and will use the points when farther away. This would explain the darkening effect that you're seeing. If you instead use an illuminance loop (which doesn't use multiple importance sampling), it won't use any geometry samples and you won't see this effect.

For your second question, I think you missed the “Cd” attribute that is also stored in the point cloud. This is what controls the brightness of the point, in combination with the “volume” or “A” channel (depending on whether the points were generated from a volume or a surface). Density doesn't really have any effect on the generated points unless you used it to compute the “Ce” export (which is what ends up in the “Cd” in the point cloud).

Andrew
User Avatar
Member
48 posts
Joined: June 2011
Offline
Thanks Andrew. I'm aware I'm probably going completely off track with it, your help is much appreciated.

I hadn't missed the Cd attribute, just forgot to bring it up. That's actually another point of confusion - I seem to end up with the number 4.82418 baked to the Cd attributes on all particles in the cloud, uniformly, no matter what I do.

What would be the definitive correct way to set up a volume which emitted light?
I'm aware I should be using a Ce export, but I'm not entirely sure how to export it to the point cloud sampler on the geometry light.
The two attempts I've tried are:
1. Create a vector volume in SOPs, call it Ce, and fill it with values. Then point the “Geometry Object” field on the light to that object.
2. Create a scalar volume called temperature, set up a pyro shader which uses temperature as the Fire Color input field, set the volume object material to the pyro shader, and again, point the geometry light to that object.

Both attempts don't seem to inherit anything resembling the data in the Ce or temperature volumes when generating the point cloud, except for only generating points in non-zero areas.

I presume I'm just setting it up completely wrong.
User Avatar
Member
1002 posts
Joined: July 2005
Offline
I'm a little confused about exactly how you're trying to set this up, but it's one of the following:

1) You want to use auto-generation to create the points, exactly the way it's done with built-in shaders. In this case, you just need to set up a Ce export parameter (vector type) on your custom shader and assign something to this for the emission. The simplest possible case is to plug in a constant multiplied by dPdz for a volume, or just a constant for a surface. You can look at other built-in shaders to see how this is done, since it's handled exactly the same way as it is when not using point clouds.

2) You're trying to roll your own point cloud creation, bypassing the auto-generation. In this case you can put whatever you want directly into Cd when you make the point cloud. Don't scale it by the step size since the built-in auto-generation divides out the step size before saving Cd. Refer back to a point cloud generated from (1) to make sure you're filling in the correct data.

I'm assuming that you have already tried using the volume light shelf tool and geometry light directly with the pyro shader, since this should work correctly out of the box. Geometry lights with point clouds should also work with non-volume geometry including curves in the latest daily builds of 12.5.

Andrew
User Avatar
Member
48 posts
Joined: June 2011
Offline
I'm trying to set up a working example emitting light from an emissive volume, so I can look at the point cloud it generates, and understand what it's generating, so I can roll my own in a correct way.

I didn't spot the shelf tools (I usually have the shelf minimized :-)

Using the Volume Light tool and selecting my volume geometry object, it actually creates a light set up identically to how I'd done it.


Aha… I've just worked out where I was going wrong. However I was setting up the pyro shader must not have been exporting Ce values correctly.
I grabbed the Constant Smoke shader from the Material Palette, and just set the volume object to be a normal scalar volume called “density”, and crucially, specified that shader in the Material field on the geometry light. I'd tried it before with the pyro shader, but it was obviously the shader not the method I had wrong.
I now get meaningful Cd values generated in my point cloud.


Thanks for your help Andrew.

One last thing, can you give any insight into what the weight/volume/A attributes represent, and how they affect the render?

I'm guessing weight has something to do with the importance sampling you mentioned, and volume would be the x*y*z space represented by each point.

With weight and A, I just can't quite work out what the scale of the numbers might relate to - both seem to range between 0.0 and no larger than around ~0.001 per point.
User Avatar
Member
1002 posts
Joined: July 2005
Offline
The weight channel is created as a product of the volume and Cd for volumes or volume and A for surfaces. It's used in the pcopenlod() method to determine how much each point contributes to the result. You might want to look at the shaders that are involved in this process to get a better idea of how the channels are created and used:

pcwriter.vfl (fog shader) - used for writing out the auto-generated points
sampler_pclight.vfl (light shader) - used for sampling the point cloud
tracer_pclight.vfl (light shader) - used to trace the geometry for the geometry light

These should now be in the shipped baseline in $HH/vex

Andrew
User Avatar
Member
48 posts
Joined: June 2011
Offline
Ah right, I'll take a look into those.

Thanks again, I think this should set me on the right path.
User Avatar
Member
48 posts
Joined: June 2011
Offline
Hehe, maybe a little ambitious, can't make head-nor-tail of the vex shaders… my technical abilities end just short of proper coding.


But I seem to have settled on a solid result.

For my purposes, it appears that A can be safely set to a constant value for all points, volume as a sensible per-point volume size, Cd to my intended light output per-point, and weight to Cd*volume (well, scalar luminosity of Cd * volume)


I've just tried plugging my custom point cloud in as the light's Geometry Object, as well as the point cloud file, and it appears to work correctly, in so far as it uses the geometry input for near samples, and point cloud for far samples.
Does this sound like a reasonable thing to do, in realism terms?
Oddly, it won't emit any light at all from the geometry input, unless I also have the point cloud switched on. Does enabling point cloud also allow the light to sample point-only geometry?

(Hehe, I'll stop bugging you soon, I promise!)
User Avatar
Member
1002 posts
Joined: July 2005
Offline
I'm not sure why it would not emit light without the point cloud, perhaps submit a question to support with your file and we can have a look.
  • Quick Links