Search - User list
Full Version: Primvar to Geolight Render Masks per color or per prim etc
Root » Technical Discussion » Primvar to Geolight Render Masks per color or per prim etc
tricecold
Hello; above topic is a little complex but i will try to explain here

I am trying to figure out a way for outputting a mask for my Geolight

Assume that I have one geolight in different areas of my scene using one geometry. Each Geometry is merged into one node and fed into the geo light but I still have point or prim attributes to keep these prims unique.

Is there a way for me to create a mask per attribute on the illuminated object, so I can grade them individually even if they are coming from one light.
jsmack
What renderer are we talking about here? If mantra, it's only vaguely possible in the sense that you could make a custom pathtracer/integrater that gathers whatever you want from a geometry surface shader.

The built-in integrator is only concerned with illumination, not attributes.
tricecold
It's Mantra, I assumed there must be a way to trace the Ray back to its source and get attribute.

Looking in documentation currently. Any possible pointers ?
ZeitG
Hello, tricecold.

1. based on camera you can create a points grid in NDC space, point per pixel. Than make a direction vector from centre of camera till each point. This is going to be an image representation with points.
2. Using intersect function you may find new points (pixels) position in your scene.
3. For each point create a vector till each light (easy to do this in foreach loop) and again with intersect function find an intersection with geometry in you scene. If intersection is -1 this mean pixel will be affected by light. Put each light in array, based on this array you can read from light whatever you want.

if you have a particles - convert position of all particles to NDC, find closest pixel ( but in this case you need to have something like a pixel samples to define exact position )

if you have a volumes. create a point per voxel (or try any different resolution), than find an intersection with geometry in your scene based on path to light, store this info, and back it camera as particles. Or grid (2x2) per voxel, store density value for each grid, and with intersectall for pixel (point) iterate inside array till density >= 1

In this case on each point (pixel) you may store everything, light name, geo name, distance and do with this whatever you want.

Is this a best way or not - I do not know. I hope it will help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB