Hi Folks,
I’m implementing a view-dependent HdGpGenerativeProcedural
, i.e. it requires access to a camera (including pixel resolution and screen window, a.k.a. data window). In USD this information is neatly packaged into a RenderSettings
prim.
My test scene looks something like the following (based on exporting from Houdini/Solaris):
#usda 1.0
(
# ...
)
def Scope "world"
{
def GenerativeProcedural "my_proc1" (
prepend apiSchemas = ["HydraGenerativeProceduralAPI"]
)
{
token primvars:hdGp:proceduralType = "MyProc"
rel primvars:renderSettingsPath = </Render/rendersettings>
# Other procedural parameters as primvars....
}
}
def Xform "cameras"
{
def Camera "camera1"
{
# Standard camera params...
}
}
def Scope "Render"
{
def RenderSettings "rendersettings"
{
token aspectRatioConformPolicy = "expandAperture"
rel camera = </cameras/camera1>
float4 dataWindowNDC = (0, 0, 1, 1)
bool disableMotionBlur = 0
token[] includedPurposes = ["default"]
token[] materialBindingPurposes = ["full", "allPurpose"]
float pixelAspectRatio = 1
rel products = None
int2 resolution = (2048, 1152)
}
}
The idea is that the procedural has a relationship to a RenderSettings
prim, from which it can grab the camera information. This approach is similar to how the _CubePerMeshPointProcedural uses a relationship to access the points of another mesh in the scene.
I was expecting that USD RenderSettings
could be accessed in a similar fashion, whereby I could find the RenderSettings data source using inputScene->GetPrim()
. Hypothetically I could then use the HdRenderSettingsSchema
to access the required parameters. However, this turns out not to be the case. There doesn’t seem to exist a prim in the Hydra scene corresponding to the path specified by the relationship.
My stumbling attempts att using the Hydra Scene Browser in usdview seem to confirm that this is in fact the case, as I cannot locate any data that corresponds to the USD RenderSettings
.
Now, the Houdini docs suggest that RenderSettings
are passed to the render delegate at the time it is created. Also worth noting is that I get a warning in Houdini/Solaris when I add a “Render Settings” node to my LOP graph:
Selected hydra renderer doesn't support prim type 'RenderSettings'
My question is: Is there a way to access the current render settings from within a HdGpGenerativeProcedural
?
Taking it one step further would be to be able to define a relationship to a specific RenderSettings
instance for the procedural to use.
Thanks in advance,
Tommy