@MagnusL3D: Nice video! It is great to see procedural asset creation for assets like this. I can imagine processing an entire environment like this
I've tested the attached renaming script and it is working for me. Are you sure you're using the latest build? Are you specifying the script to Mantra? For example:
mantra -P filter.py test.ifd
I'll look at the naming format for the extracted image planes. We can certainly use ‘_’ instead of ‘.’. At the moment the “quick” image plane toggles use fixed naming (eg. ‘diff_clr’), but we could add a text field beside the toggle allowing you to specify a different channel name (eg. ‘Diffuse’).
The color space is selected based on the image format. 8-bit formats like TGA should be converted to sRGB. EXR/RAT are left as linear. I'm guessing this is the behavior you'd want for Unreal? Or does it accept linear images? I'll look into this to ensure sRGB is being used for TGA.
Found 37 posts.
Search results Show results as topic list.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: Wow, now you're jumping through some serious hoops (on fire?)! Hopefully we can get you going with the combination of script post-processing and geometry output.
I've added the object output (see attached), which uses the same formatting as the ‘Output Picture’ parameter. All formats supported by the File SOP are available. This way you can process in batch, like so:
UV Object 1: /obj/lowres*
High Res Object 1: /obj/highres*
Output Picture 1: $HIP/*.rat
Output UV Object 1: $HIP/*.obj
Could you send an example .mtl file? It would be great to understand your setup to see if it applies to others. There could be some standard post-processing scripts we could add (eg. write out HDAs, import baked shaders into Houdini, etc.).
I've added the object output (see attached), which uses the same formatting as the ‘Output Picture’ parameter. All formats supported by the File SOP are available. This way you can process in batch, like so:
UV Object 1: /obj/lowres*
High Res Object 1: /obj/highres*
Output Picture 1: $HIP/*.rat
Output UV Object 1: $HIP/*.obj
Could you send an example .mtl file? It would be great to understand your setup to see if it applies to others. There could be some standard post-processing scripts we could add (eg. write out HDAs, import baked shaders into Houdini, etc.).
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D:
1. The script can live in the same directory as the .hip file ($HIP), or anywhere within your Python path.
2. The new filter callback will be available in the next daily build.
1. The script can live in the same directory as the .hip file ($HIP), or anywhere within your Python path.
2. The new filter callback will be available in the next daily build.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: The script is part of the Python filtering in Mantra, which is really handy. I've added a new function that gets called after the render completes, which passes a list of generated files. For example:
[['/obj/lowres', <- Asset name
[
, <- File, Type
<- File, Type
<- File, Type
]
]]
…where ‘Type’ identifies the file type:
0 - Image
1 - Texture
2 - Geometry
I've attached an example filter that you can modify to suit your purposes. You specify the filter to Mantra using the ‘-P’ flag:
mantra -P filter.py
I'll get back to you about the Games group's input on this.
[['/obj/lowres', <- Asset name
[
, <- File, Type
<- File, Type
<- File, Type
]
]]
…where ‘Type’ identifies the file type:
0 - Image
1 - Texture
2 - Geometry
I've attached an example filter that you can modify to suit your purposes. You specify the filter to Mantra using the ‘-P’ flag:
mantra -P filter.py
I'll get back to you about the Games group's input on this.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: In terms of the asset preparation step this is likely something that we would defer to our Games team as they are familiar with the requirements of various engines (eg. Unreal, etc). This would likely be implemented as a dedicated post-render script that could be shipped with Houdini. You would select “Unreal” formatting and the asset could be packaged as required.
I've almost completed the work with the filter script, which is just an extension to our Python filter. There is a new function ‘filterOutputFiles()’ which is passed a list of files output by the ROP. You are free to process these as needed (renaming, conversion, publishing). This is the most generic way to present this, and won't require us hardening specifics of your pipeline into Houdini. Once this is in place we will be able to give you some examples of how best to format for Unreal.
I've almost completed the work with the filter script, which is just an extension to our Python filter. There is a new function ‘filterOutputFiles()’ which is passed a list of files output by the ROP. You are free to process these as needed (renaming, conversion, publishing). This is the most generic way to present this, and won't require us hardening specifics of your pipeline into Houdini. Once this is in place we will be able to give you some examples of how best to format for Unreal.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: Thinking some more about the formatting of the output images, it might be difficult to second-guess what users need. Adding too many controls to the UI may also be more confusing than helpful. If you're Ok with the script approach I think this might be best. This way you're free to do any post-processing (renaming, conversion) you like.
The output geometry would likely be a parameter just after the ‘Output Picture 1’ path, under the ‘UV Render Objects’ list. The default path will be empty, meaning no geometry will be output.
In terms of flipping the normal map channels, this is something that is already possible with the VOP but has not been exposed in the Bake Shader; I can add this. When you say “-invert Cd” for roughness, what do you mean? Inverting the color?
There is one small UI change coming: the image planes that are related to the Bake Shader have been relocated to that tab to make things clearer (ie. they are only relevant for that shader). I'll look into adding the script and let you know once there is something to test with. Thanks for all the suggestions
The output geometry would likely be a parameter just after the ‘Output Picture 1’ path, under the ‘UV Render Objects’ list. The default path will be empty, meaning no geometry will be output.
In terms of flipping the normal map channels, this is something that is already possible with the VOP but has not been exposed in the Bake Shader; I can add this. When you say “-invert Cd” for roughness, what do you mean? Inverting the color?
There is one small UI change coming: the image planes that are related to the Bake Shader have been relocated to that tab to make things clearer (ie. they are only relevant for that shader). I'll look into adding the script and let you know once there is something to test with. Thanks for all the suggestions
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: In addition to what Mark has mentioned we could set up the ROP to output the lowres object using whatever format you like. When combined with the script this would let you do post-processing of your asset (publishing into asset tree, conversion to engine, etc.).
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: The script would be called with the full paths to all files generated by the render. This would allow you to do your own processing of the images (building texture atlases, color space conversions, renaming). I could provide you with an example script that you could modify, if that helps.
We could also add a format string, which would work like the ‘Output Picture’ parameter. You refer to the various parts of the filename with an expression:
B - Base image name
P - Plane name
T - Udim tile number
E - Extension
%B_%P.%T.tga
…which would generate:
image_Nt.1001.tga
This might be the most flexible as you wouldn't need to choose the output format: it would be picked up from the extension. You would not need a script in this case.
We could also add a format string, which would work like the ‘Output Picture’ parameter. You refer to the various parts of the filename with an expression:
B - Base image name
P - Plane name
T - Udim tile number
E - Extension
%B_%P.%T.tga
…which would generate:
image_Nt.1001.tga
This might be the most flexible as you wouldn't need to choose the output format: it would be picked up from the extension. You would not need a script in this case.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: Wow! Very nice work. Great to see this living in the engine
I've added an option to choose the extracted format for the image planes (see attached). In terms of handling custom naming formats it might be safest to do this via a script. We could call a python script with the output filenames and let you handle any post-processing (eg. renaming, filtering, converting, publishing to database).
I've added an option to choose the extracted format for the image planes (see attached). In terms of handling custom naming formats it might be safest to do this via a script. We could call a python script with the output filenames and let you handle any post-processing (eg. renaming, filtering, converting, publishing to database).
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: Looking fantastic
It will be easier to incorporate custom outputs like this with H16. The new setup will separate the unwrapping/correspondence from the shading, which means that you will not need to worry about scope for the trace. You will also not be limited to a fixed set of outputs when baking from highres > lowres, either (eg. ‘diff_clr’). This should be helpful with textures like your grit mask.
It will be easier to incorporate custom outputs like this with H16. The new setup will separate the unwrapping/correspondence from the shading, which means that you will not need to worry about scope for the trace. You will also not be limited to a fixed set of outputs when baking from highres > lowres, either (eg. ‘diff_clr’). This should be helpful with textures like your grit mask.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: We can certainly look at adding different noise patterns. I'm not sure of how much material there is out there, but other users may have added additional noise VOPs; have you had a look?
Yes, the diced mesh baking with displacement would produce a large mesh, but if handled in tiles it could be brought into another application without too much of a headache. Even without dicing, just being able to bake down shading to vertex attributes should come in handy (eg. for pre-lighting).
It should be possible to offer some control over the output image plane naming. We could add a post-frame script that would be passed the file path to any generated images, which would give you the opportunity to rename/edit them. There is also an option in the image plane dialog to save to a different file, with custom naming. I'm not sure if this competes with the built-in planes, though (eg. overriding the ‘Nt’ plane with your own filename). What sort of naming format are you using?
@tamte: Yes, Corona has some great features, like Importons:
https://corona-renderer.com/blog/research-corner-progressive-importance-sampling/ [corona-renderer.com]
We could look at adding adaptive displacements. It would certainly help with reducing the complexity of baked geometry.
Yes, the diced mesh baking with displacement would produce a large mesh, but if handled in tiles it could be brought into another application without too much of a headache. Even without dicing, just being able to bake down shading to vertex attributes should come in handy (eg. for pre-lighting).
It should be possible to offer some control over the output image plane naming. We could add a post-frame script that would be passed the file path to any generated images, which would give you the opportunity to rename/edit them. There is also an option in the image plane dialog to save to a different file, with custom naming. I'm not sure if this competes with the built-in planes, though (eg. overriding the ‘Nt’ plane with your own filename). What sort of naming format are you using?
@tamte: Yes, Corona has some great features, like Importons:
https://corona-renderer.com/blog/research-corner-progressive-importance-sampling/ [corona-renderer.com]
We could look at adding adaptive displacements. It would certainly help with reducing the complexity of baked geometry.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: I will look into the use of TGA's for image plane output. If this is not possible we may add an output format parameter to use when extracting image planes.
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: Thanks for describing your workflow; it looks like a really nice setup for automating weathering/damage effects.
In terms of working with meshes between Houdini and other applications, there are plans to offer an option to bake out displaced meshes, inclusive of dicing. This would include the output of shaders, as well as offering options to bake to per-vertex attributes (eg. for pre-lighting scenes/assets).
The attached shows the use of max distance for the trace between lowres > highres objects. In the C plane (diagnostic) you can see where the highres object is being hit (light green above the normal, dark green below), and missed (red). The alpha plane could be used to cut out areas that are missed in the trace, like windows, for example. The base normals are left unmodified in the missing areas for the normal map (ie. as opposed to filling with black).
In terms of working with meshes between Houdini and other applications, there are plans to offer an option to bake out displaced meshes, inclusive of dicing. This would include the output of shaders, as well as offering options to bake to per-vertex attributes (eg. for pre-lighting scenes/assets).
The attached shows the use of max distance for the trace between lowres > highres objects. In the C plane (diagnostic) you can see where the highres object is being hit (light green above the normal, dark green below), and missed (red). The alpha plane could be used to cut out areas that are missed in the trace, like windows, for example. The base normals are left unmodified in the missing areas for the normal map (ie. as opposed to filling with black).
Work in Progress » H15 Baking
- mdavies
- 110 posts
- Offline
@MagnusL3D: These tests are looking terrific Could you explain a bit about your method for the procedural weathering (eg. VDB operations, etc.)?
There are some new additions to baking coming that should help in your work:
-Max distance control. Hits on the highres object farther away than this value will be ignored.
-Ray controls. You will be able to specify the origin and direction of trace rays manually. These will be controlled using vector attributes on the lowres object. Normally the trace method uses the surface normal, however this will help in cases where finer control is required.
-Diagnostic output. The bake will store this in the ‘C’ image plane, which has caused some confusion in the past, being black by default. The diagnostic colors are:
Red - Rays missed the highres object
Green - Rays hit the highres object along the positive normal
Cyan - Rays hit the highres object along the negative normal
-Alpha output. This will be a “stencil” mask, with white in areas where the highres object was hit. This is helpful when the lowres object is a flat plane wrapped to detailed highres geometry. This is intended to be used as an opacity map.
I'll let you know once there is a build available with these features for testing. Thanks for all your help in moving these tools along; it has been great to have your input
There are some new additions to baking coming that should help in your work:
-Max distance control. Hits on the highres object farther away than this value will be ignored.
-Ray controls. You will be able to specify the origin and direction of trace rays manually. These will be controlled using vector attributes on the lowres object. Normally the trace method uses the surface normal, however this will help in cases where finer control is required.
-Diagnostic output. The bake will store this in the ‘C’ image plane, which has caused some confusion in the past, being black by default. The diagnostic colors are:
Red - Rays missed the highres object
Green - Rays hit the highres object along the positive normal
Cyan - Rays hit the highres object along the negative normal
-Alpha output. This will be a “stencil” mask, with white in areas where the highres object was hit. This is helpful when the lowres object is a flat plane wrapped to detailed highres geometry. This is intended to be used as an opacity map.
I'll let you know once there is a build available with these features for testing. Thanks for all your help in moving these tools along; it has been great to have your input
Technical Discussion » Trouble getting Bake Texture work
- mdavies
- 110 posts
- Offline
Hi,
I've found that this is related to the UVs of the box object. If you rotate them by 1 degree the bake works as expected. I will need to look a bit deeper, but I believe this is an issue with the tangent basis, which seems to be degenerate in some cases. Note that this issue only affects the tangent-space normals; all other bake channels work as expected.
The attached shows the working setup. I've also had success using a different UV layout for the box (try UV Unwrap, for example).
~M
I've found that this is related to the UVs of the box object. If you rotate them by 1 degree the bake works as expected. I will need to look a bit deeper, but I believe this is an issue with the tangent basis, which seems to be degenerate in some cases. Note that this issue only affects the tangent-space normals; all other bake channels work as expected.
The attached shows the working setup. I've also had success using a different UV layout for the box (try UV Unwrap, for example).
~M
Technical Discussion » Trouble getting Bake Texture work
- mdavies
- 110 posts
- Offline
Hi,
I'm looking into the tangent normal output as this does look incorrect for this scene.
In terms of edge padding, are you rendering to disk or MPlay? The edge padding is currently only supported for images rendered to disk.
I'm looking into the tangent normal output as this does look incorrect for this scene.
In terms of edge padding, are you rendering to disk or MPlay? The edge padding is currently only supported for images rendered to disk.
Technical Discussion » Trouble getting Bake Texture work
- mdavies
- 110 posts
- Offline
Hi,
If you look at the extra images planes output by the bake you should see the various outputs: N, Nb, Nt. When baking with the Bake Shader the ‘C’ plane is black, which is normal. All the bake data is handled by the extra image planes. Could you verify that switching planes within MPlay shows the correct outputs? Thanks.
~M
If you look at the extra images planes output by the bake you should see the various outputs: N, Nb, Nt. When baking with the Bake Shader the ‘C’ plane is black, which is normal. All the bake data is handled by the extra image planes. Could you verify that switching planes within MPlay shows the correct outputs? Thanks.
~M
-
- Quick Links