I would need help getting started on a Shader Translator for Redshift.
I have been successfully making objtranslators for Redshift but am lost with the shadertranslators.
I have been looking at the code in ../husd/shadertranslator.py as well as the examples in ../husdplugins/shadertranslators and i am a bit overwhelmed.
It seems like it would be simple, but i am lost in the amount of methods.
Any kind of help sending me in the right path would be greatly appreciated.
What i am looking to do is convert redshift_material -> redshift_usd_material
Theses nodes usually reside in a redshift_material_builder(redshift_vopnet)
Reason being that redshift_material does not convert to usd
Found 7 posts.
Search results Show results as topic list.
Solaris and Karma » Shader Translator Help - Redshift
- mapoga
- 7 posts
- Offline
Technical Discussion » HDK SceneRenderHook - get camera info
- mapoga
- 7 posts
- Offline
For those interested, is was able to get the camera position with:
And was able to convert the 3D point to screen space with:
// Parameter from DM_SceneRenderHook.render(RE_Render *r, ...) RE_Render *r; // View matrix UT_Matrix4D view_mat; r->getMatrix(view_mat); view_mat.invert(); // Camera position UT_Vector3 camera_pos = UT_Vector3(0,0,0); camera_pos = rowVecMult(camera_pos, view_mat);
And was able to convert the 3D point to screen space with:
// Parameter from DM_SceneRenderHook.render(RE_Render *r, ...) RE_Render *r; // 3D point UT_Vector3 pos3; // View matrix UT_Matrix4D view_mat; r->getMatrix(view_mat); // Projection matrix UT_Matrix4D proj_mat; r->getMatrix(proj_mat, RE_MATRIX_PROJECTION); UT_DimRect viewport = r->getViewport2DI(); // World position fpreal xw = pos3.x(); fpreal yw = pos3.y(); fpreal zw = pos3.z(); // Screen position fpreal xs; fpreal ys; r->mapScreen(xw, yw, zw, viewport, proj_mat, view_mat, &xs, &ys);
Technical Discussion » HDK SceneRenderHook - get camera info
- mapoga
- 7 posts
- Offline
Hi its my first time using the HDK. My goal is to make a scene scale visualiser similar to the one from speedtree. A vertical ruler on the right of the object with the measurement shown in text at the top of it.
I am using the SceneBoundsHook.C sample scene as a base and have been able to modify it to work on selected objects and make custom geo.
What i am missing is a way to get the camera info. In cases where there is a node in the scene for it or its the default perspective camera.
With the camera world transform and its view transform i would be able to:
- Make the custom geo look at the camera at all times.
- Convert a 3d point to a viewport 2d point in order to place text.
Thank you in advance i am new to the hdk and it can be hard to know where to look at the beginning.
I am using the SceneBoundsHook.C sample scene as a base and have been able to modify it to work on selected objects and make custom geo.
What i am missing is a way to get the camera info. In cases where there is a node in the scene for it or its the default perspective camera.
With the camera world transform and its view transform i would be able to:
- Make the custom geo look at the camera at all times.
- Convert a 3d point to a viewport 2d point in order to place text.
Thank you in advance i am new to the hdk and it can be hard to know where to look at the beginning.
Solaris and Karma » Solaris - EXR Matrix Metadata
- mapoga
- 7 posts
- Offline
Thank you No_ah!
In Redshift's latest release they added their own exr output. Same as the OBJ level exr output which includes camera metadata.
While not render agnostic, it would meet my current needs.
Once i can get my hands on the new release i will test this new feature.
Another option would be to stringify the matrix. While not clean it would work.
My ideal solution would be for USD to add a m44f type. A man can dream.
Have a nice day.
In Redshift's latest release they added their own exr output. Same as the OBJ level exr output which includes camera metadata.
While not render agnostic, it would meet my current needs.
Once i can get my hands on the new release i will test this new feature.
Another option would be to stringify the matrix. While not clean it would work.
My ideal solution would be for USD to add a m44f type. A man can dream.
Have a nice day.
Solaris and Karma » Solaris - EXR Matrix Metadata
- mapoga
- 7 posts
- Offline
Thank you for your help and attached scene.
I wasn't aware iinfo existed and it pretty neat. Turns out my m44d metadata worked.
I still have the issue where i need to read that metadata in nuke and unless the matrix is saved as a m44f, nuke does not seem to recognize it.
I see that you tried that in your usd scene and even gave an explanation and documentation. Sadly it does not export to either iinfo or nuke.
Conversely, karma was able to export matrices in m44f that is recognized by both iinfo and nuke.
Should i keep hope in a possible driver:parameters:OpenEXR export that works with nuke in the future?
I might have to make a feature request to either Redshift, nuke or USD?
Thank you!
I wasn't aware iinfo existed and it pretty neat. Turns out my m44d metadata worked.
I still have the issue where i need to read that metadata in nuke and unless the matrix is saved as a m44f, nuke does not seem to recognize it.
I see that you tried that in your usd scene and even gave an explanation and documentation. Sadly it does not export to either iinfo or nuke.
Conversely, karma was able to export matrices in m44f that is recognized by both iinfo and nuke.
Should i keep hope in a possible driver:parameters:OpenEXR export that works with nuke in the future?
I might have to make a feature request to either Redshift, nuke or USD?
Thank you!
Solaris and Karma » Solaris - EXR Matrix Metadata
- mapoga
- 7 posts
- Offline
Could i get an example of how to write a camera transform into a rendered exr metadata?
I managed to get Float and String data working but not Matrix4 or List of floats. I dont get an error but the exr does not contain the metadata even if the prim attribute exists.
As a side question, how can i use namespaces in the metadata. For example how can i get this as a metadata key?
Colons are working but are not backwards compatible with non Solaris renders. Forward slash would be preferable.
Working:
Not working:
I managed to get Float and String data working but not Matrix4 or List of floats. I dont get an error but the exr does not contain the metadata even if the prim attribute exists.
As a side question, how can i use namespaces in the metadata. For example how can i get this as a metadata key?
exr/rs/camera/transform
Working:
metadata_attribute = renderproduct.GetPrim().CreateAttribute("driver:parameters:OpenEXR:aperture", Sdf.ValueTypeNames.Float) metadata_attribute.Set(GFCamera.horizontalAperture)
Not working:
metadata_attribute = renderproduct.GetPrim().CreateAttribute("driver:parameters:OpenEXR:transform", Sdf.ValueTypeNames.Matrix4d) metadata_attribute.Set(GFCamera.transform)
metadata_attribute = renderproduct.GetPrim().CreateAttribute("driver:parameters:OpenEXR:transform", Sdf.ValueTypeNames.FloatArray) mat = GFCamera.transform flatten_mat = list([element for tupl in mat for element in tupl]) metadata_attribute.Set(flatten_mat)
Technical Discussion » CHOP: switch value and time
- mapoga
- 7 posts
- Offline
In SOP i am animating the frame param of a timeshift to warp time and create a slowmotion effect on a cached sim.
I would like to be able to reverse that timeshift by using second timeshift.
I hope to do this in chop by reading the animation of the parameter on the first timeshift and flipping the values x->y and y->x.
Another way to think about it would be to mirror a channel across a diagonal.
My chop knowledge is limited and i cant seem to find the right tool for the job.
Any suggestions?
I would like to be able to reverse that timeshift by using second timeshift.
I hope to do this in chop by reading the animation of the parameter on the first timeshift and flipping the values x->y and y->x.
Another way to think about it would be to mirror a channel across a diagonal.
My chop knowledge is limited and i cant seem to find the right tool for the job.
Any suggestions?
-
- Quick Links