how to bake the 3d vector field to xz plane and xy plane color textures?

   4835   11   1
User Avatar
Member
54 posts
Joined: Oct. 2017
Offline
hi all,i want to project the 3d vector field to xz plane vertex color and xy vertex color,then bake to colormap,so, can
make the gpu particle moving in unity.How to project the 3d vector field?Any example?
Edited by dreamerflyer19 - Nov. 20, 2017 11:56:45
User Avatar
Member
252 posts
Joined:
Offline
Hi, you could probably use the Volume Slice SOP to read volume data onto a plane. I attached an example file.

Or use the volumesample() function in wrangles.

Note that the resulting color data might need to be massaged a bit before baking, that is because they will most likely contain negative values.

Attachments:
vel_field.rar (11.7 KB)

User Avatar
Member
54 posts
Joined: Oct. 2017
Offline
galagast
Hi, you could probably use the Volume Slice SOP to read volume data onto a plane. I attached an example file.

Or use the volumesample() function in wrangles.

Note that the resulting color data might need to be massaged a bit before baking, that is because they will most likely contain negative values.
Thanks a lot! And I export to texture not work…maybe i link the rop bake texture node not correct?see the attachment,thanks!
Edited by dreamerflyer19 - Nov. 21, 2017 12:31:34

Attachments:
vel_field.hipnc (206.2 KB)

User Avatar
Member
252 posts
Joined:
Offline
Hi, as it turns out, the Volume Slice creates a Mesh type geometry by default. So I just added a Convert SOP to convert it to polygons. The Bake Texture ROP seems to prefer polygons. I've attached an updated file below.

Also, as an added alternative to look into, You may be able to utilize COPs to directly read the color values from your geometry. Here's a thread [www.sidefx.com] that has an example.

Or, I don't know if Unity supports volume velocity fields directly, but if you look at this Unreal tutorial [www.sidefx.com], you may be able to just export the volume field directly in to your game.

Lastly, just a bonus for those looking into the baking workflow, here's [houdini.indyzone.jp] a very simple tutorial on baking. Although it is in japanese, the images are very easy to follow.

I hope this helps!

Attachments:
vel_field_bake.rar (23.7 KB)

User Avatar
Member
54 posts
Joined: Oct. 2017
Offline
galagast
Hi, as it turns out, the Volume Slice creates a Mesh type geometry by default. So I just added a Convert SOP to convert it to polygons. The Bake Texture ROP seems to prefer polygons. I've attached an updated file below.

Also, as an added alternative to look into, You may be able to utilize COPs to directly read the color values from your geometry. Here's a thread [www.sidefx.com] that has an example.

Or, I don't know if Unity supports volume velocity fields directly, but if you look at this Unreal tutorial [www.sidefx.com], you may be able to just export the volume field directly in to your game.

Lastly, just a bonus for those looking into the baking workflow, here's [houdini.indyzone.jp] a very simple tutorial on baking. Although it is in japanese, the images are very easy to follow.

I hope this helps!
Thanks a lot for your helps!I export the texture,it seems not work,may i missing something?

Attachments:
white.png (634.9 KB)

User Avatar
Member
252 posts
Joined:
Offline
Sorry, I forgot to mention, the color is saved to a separate image plane called color.

Can you check if that properly appears on your end?
Edited by galagast - Nov. 22, 2017 12:05:09

Attachments:
bake_texture_result.JPG (21.0 KB)

User Avatar
Member
54 posts
Joined: Oct. 2017
Offline
galagast
Sorry, I forgot to mention, the color is saved to a separate image plane called color.
Attachment Not Found

Can you check if that properly appears on your end?
not work..
Edited by dreamerflyer19 - Nov. 23, 2017 13:20:23

Attachments:
notwork.png (179.0 KB)
vel_field_bake.hipnc (239.6 KB)

User Avatar
Member
252 posts
Joined:
Offline
I had a quick look at your file.

Go to Bake Texture > Images > Main and check the ‘color’ image plane.
You have Light Exports set to ‘Merge all light into single channel’
Just set it back to the default ‘No light exports’

Did you set that yourself?
That would not work, because the simple shader I used that generates the ‘color’ plane does not compute lighting.

Hopefully that fixed it.

Attachments:
bake_texture_result_2.JPG (24.7 KB)

User Avatar
Member
54 posts
Joined: Oct. 2017
Offline
galagast
I had a quick look at your file.

Go to Bake Texture > Images > Main and check the ‘color’ image plane.
You have Light Exports set to ‘Merge all light into single channel’
Just set it back to the default ‘No light exports’
Attachment Not Found

Did you set that yourself?
That would not work, because the simple shader I used that generates the ‘color’ plane does not compute lighting.

Hopefully that fixed it.
still not work….
User Avatar
Member
252 posts
Joined:
Offline
That is odd.. I opened the file that you attached.
And the only thing I changed was the Light Exports setting I suggested.

Here's a capture of what I did:

As can be seen, I set the Light Exports to the default, then hit Render to MPlay. The results does show the velocity colors baked.

I wonder why it doesn't work on your end. Your file does show that we are using the same version of Houdini.

I attached the new file, could you open this and hit Render to MPlay, then check if you can see the ‘color’ image plane?
H16.5.268 Indie

Attachments:
bake_texture_result_2.gif (497.6 KB)
vel_field_bake_2.rar (26.7 KB)

User Avatar
Member
54 posts
Joined: Oct. 2017
Offline
galagast
That is odd.. I opened the file that you attached.
And the only thing I changed was the Light Exports setting I suggested.

Here's a capture of what I did:
Attachment Not Found

As can be seen, I set the Light Exports to the default, then hit Render to MPlay. The results does show the velocity colors baked.

I wonder why it doesn't work on your end. Your file does show that we are using the same version of Houdini.

I attached the new file, could you open this and hit Render to MPlay, then check if you can see the ‘color’ image plane?
H16.5.268 Indie
Thanks very much! it works! But i confused with this,what is different with color and cf in vex variable channel?and i save to jpg format ,not work.
Edited by dreamerflyer19 - Dec. 3, 2017 11:31:04

Attachments:
not.jpg (301.0 KB)
can.jpg (251.8 KB)

User Avatar
Member
252 posts
Joined:
Offline
I used ‘color’ simply because it is easier to understand You can bind it to any name you want.

Regarding saving to JPG, it won't work probably because JPG does not support multiple channels or image planes.
  • Quick Links