Jump to content

Per-light exports of multiple sampled variables ?


Recommended Posts

I'm trying to set up some shader exports from area lights, but I cant seem to understand at what stage mantra is getting the variable from an illuminance loop during per light exports.

I thought some array hackery in the illuminance loop, which would reset the variable when a light is finished evaluating, would work:

...

renderstate("light:name", lightName);
arrLen = arraylength(lightNameList);
if ( arrLen != 0 && lightName != lightNameList[arrLen-1] ) {
    sampleCount = 0;
    myOutputVar = 0;
    lightNameList = string(array());
}

// Do some stuff with myOutputVar

push(lightNameList, lightName);

But the same data, the end result for all lights, still gets written to each light's plane.

Has anyone gotten something like this to work, or is there some internal limitation which is cramping my style?

Edited by mrice
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...