Jump to content

Instancing fun


jim c

Recommended Posts

So I decided to play around with instancing - thanks to Peter Bowmar's excellent tutorial at cg-masters!

The only thing I couldn't get quite right is the light instancing. I can get multiple copies of the light to show up fine. But if I want the light(s) to have shadow maps, instead of ray traced shadows, then it seems to just go on forever trying to create the shadowmap file. I presume the problem is related to it using the same file name which keeps getting overwritten by each light instance?

The other thing that surprised me is the light settings. I have a single spotlight that is positioned roughly to the left of the camera, pointing into the scene, set for physical attenuation, and with a light intensity of ~20 or so. I'm also instancing a series of point lights on the top of the hall. These are also set to have physical attenuation, but with an intensity of ~2. But it shines a surprising amount of light into the scene. Is that to be expected? Or is it understood that you also need to fool around with the attenuation settings, the max distance, and the ramp?

Attached is the test render from last night. The fog is courtesy of an Atmosphere object plus the vex lit fog shader.

The attached pic is with the gamm set to 1.6 - gamma at 2.2 was way too bright, which I suppose means that the lights are also too high.

post-4235-134729241517_thumb.jpg

Edited by jim c
Link to comment
Share on other sites

Nice shot... Can see you like Prometheus! :D

I've instanced point lights before and when using shadow maps it does take some time initially to create all the maps, one per light obviously, so I just set them to a low resolution after all the important thing for me was to get the cumulative effect of the maps, rather than well defined shadows.

Cheers

Link to comment
Share on other sites

yeah, bit of a fan of that one :)

Were you generating separate files for each light instance? How did you get that to work? When I tried it it was definitely *NOT* generating files per instance, just overwriting the same file over and over.

Edited by jim c
Link to comment
Share on other sites

  • 2 weeks later...

the variable is $IPT which provides the point the light is instanced on. that way each map gets a unique name.

Yep that was exactly it! I didn't realize that the IPT variable would be available. After some further reading, it seems like once a variable is "instanced" or made active, or whatever the correct term is, that variable has a global scope? Is that actually correct?

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...