H11 OpenGL light masking - Bugs or OGL limitations?

   4997   6   1
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Hi Mark,

So, I've been exploring the OGL stuff in H11, and I have to say the more I know about it the more I find it immediately useful!

For example, I didn't know that you (SESI; not sure if you coded it) had tied the atten ramp to the OGL display of the light, which is fully awesome!

One thing that came up was using it for lighting masking visualization. Unfortunately, it kind of falls down here, though it works enough that it makes me think it's supposed to work. So my questions are likely “bug or GL issue” oriented.

Note that I'm testing this in 11.0.561 with a Quadro FX 4800 using driver 256.something.something (if it's important I'll check at work tomorrow) as well as a GeForce 7600GS driver 195.36.15 (though I could easily upgrade if you felt it would help). Since both results are identical, I suspect it's not a GL 2.0 vs GL 3.0 issue, but of course you would know best!

First thing up: The Shadow Mask field does not appear to work in OpenGL, should it? In the attached demo file, using the Light Linker (which is correctly updating the Shadow Mask and Light Mask fields as appropriate) I can't have the Spot cast shadows from the Tube, but set the Point to be casting from only the Grid, it still casts from the Tube.

Next up: Some funkiness when using Light Masks. You should play with this a bit, but what I'm seeing is that when I adjust the light masks, contributions from unaffected lights disappear. For example, by default the Spot and Point are lighting both the grid and tube. However, when I (using the Light Linker set to Light Mask : Light-Centric) set the Spot to be none (i.e. click outside the list to deselect all objects) the OpenGL shows me _only_ the Spot light's contribution! The Light Mask on the Grid is set to “Point ^Spot” however if I type in “Spot” I get the point's contribution only illuminating the grid!

Further discovery: If I clear the Light Mask for both objects, it changes to the headlight (more on this later) and if I type in Spot into both it correctly illuminates in OpenGL. However if I type Point, it never works only if both Point and Spot are in the Light Mask (or *) do I see the Point light lighting up the viewport.

Assuming the above are bugs and fixable, there is another issue: The headlight. If both lights have either Light Enabled or Enable Light in Viewport turned off, you don't get the expected black of complete non-illumination, you get the auto headlight. Completely understandable for preventing “where the hell did my objects go?” syndrome. However, there must be a way to stop this behaviour if OGL is to be used for lighting.

I just looked through the Display options and found no way to control this.

It should be obvious why this is bad for lighting, but let me illustrate just the same If I have several lights that are all white, and I mask them all out from an object, I cannot tell in the viewport that that object is not actually illuminated! When I render it will be black (because, of course, the Headlight is not on in Mantra for production work) and that's pretty confusing.

So, there must be an option to turn off the headlight just like on Mantra. In fact, I would go so far as to argue that if you render from a viewport, the Headlight on/off option should be passed (perhaps just as a temporary override) to Mantra with appropriate warning on the Mantra node.

I thought I had a workaround using the Ambient light set to very dim, but that doesn't work either. In the test scene, add an Ambient, set it to Pink or something, and note that if you remove the Tube from the Point and Spot but not the Ambient, that the Ambient doesn't illuminate the Tube!

Anyway, I think if this masking stuff all worked nicely in the viewport it would be a massive time saver in a lot of cases.

Mark, if it's just OGL limitations, it would be good to know about, and maybe if it just can't work, remove it from the OGL display? Right now it initially appears to work, but then once you discover it doesn't actually work, some frustration has occurred

Cheers,

Peter B

Attachments:
GL_MaskingFunkiness.hip (109.6 KB)

User Avatar
Staff
5158 posts
Joined: July 2005
Offline
First thing up: The Shadow Mask field does not appear to work in OpenGL, should it?

Hi Peter,

The shadow mask doesn't affect the depth maps currently. It easily could, I think it was overlooked since the core shadowing code has been around since H10.

Light masks should definitely work in HQ Lighting mode, though I haven't run through your test in great detail yet. Normal mode I'm not so sure about, I'd have to check the code.

The headlight could be an option, but as you noticed it's not at the moment. I suppose if you were using wire-over-shaded or a non-black BG then black is a viable option.

There is a current issue with ambient lights in non-HQ lighting mode, they like to force the scene to black.

I'll take a look soon and give you the lowdown.
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Not in any way wishing to hijack this thread, I'm actually very interested in the outcomes, but where do we stand with NVidia driver version atm? I remember at one point there was a horrible bug in the latest/greatest, but seem to recall there was a hax workaround and the latest was fine.

In a fit of pique, I upgraded to 260.19.12 on Linux and have been waiting for the explosion. It seems OK so far…

Cheers,

J.C.
John Coldrick
User Avatar
Staff
5158 posts
Joined: July 2005
Offline
Both bugs I found with the Nvidia driver over the summer have been fixed, however the minor workarounds are still in place as I'm not sure how to determine the driver version in Windows Vista or 7 yet. Neither of those workarounds affect the end result.

The OSX/Nvidia bug is still present as of the 10.6.5 update, so the major workaround there is still in place. This unfortunately disables HQ Lighting support for area and environment lights, as well as infinite light support. I don't have word on when that might be fixed. The ATI bug that popped up with the last OSX graphics update was fixed in 10.6.5, though.

I've found the Nividia 260 drivers very good. Stable & excellent performance.
User Avatar
Staff
5158 posts
Joined: July 2005
Offline
I've updated Houdini so that the masking is more consistent in HQ lighting mode. The GL light list and the object light list weren't always in the same order, and this was causing the mismatches you were seeing.

Second, an object will not use the headlight if the reason it has no lighting is due to light masking. Objects will only use the headlight if no lights exist or are enabled in the scene, or the ‘Use Headlight’ toggle is on.

Finally, shadow masking is now implemented. This is in tomorrow's build, 11.0.579.
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Eggscelent, thanks Mark! I look forward to trying this out as soon as I get a moment…

Are you interested in Scene AA bugs?

Does Cristin know you work on Sundays? Isn't there a law about that in Ontario?

Cheers,

Peter B
User Avatar
Staff
5158 posts
Joined: July 2005
Offline
pbowmar
Are you interested in Scene AA bugs?

Yep, of course. Note that scene AA generally only applies to polygon coverage at the moment, and not shader effects. So sharp shader changes like shadow edges and light cutoff won't be antialiased (at least not until I add support for OpenGL 4's GL_ARB_sample_shading, for GL4-capable hardware).

Does Cristin know you work on Sundays? Isn't there a law about that in Ontario?

The kids were getting a little crazy today, needed to work a couple of hours to relax :wink:
  • Quick Links