juleslin Posted March 4, 2019 Share Posted March 4, 2019 Hi everyone! I am very new in Houdini and I hope you could help me solving this problem. I have a grass which is made of 60 long grids (photo attached), they are packed and scattered over a big grid. I would like to add random color not only on each grass but on each long grid of grass. But I am stuck because I don't know how to apply random color on something inside a packed primitive. Can anyone please advice? Thank you! Quote Link to comment Share on other sites More sharing options...
toadstorm Posted March 4, 2019 Share Posted March 4, 2019 Just apply v@Cd to the points that represent the packed primitives. Then in your shader, you either need to tell the material to "Use Packed Color" if you're using a prefab shader like the Classic Shader or Principled Shader, or if you're building it yourself, you need to include a RenderState VOP that loads the attribute packed:Cd and multiply that against the base color of the material. Quote Link to comment Share on other sites More sharing options...
Midasssilver Posted March 4, 2019 Share Posted March 4, 2019 See if something like this works for you. Rand_color_on_prims.hip Quote Link to comment Share on other sites More sharing options...
toadstorm Posted March 5, 2019 Share Posted March 5, 2019 (edited) Here's another example file: there's one example material using the built-in Use Packed Color switch that's found on the classic shader. The other example material is a constant material doing the packed color multiplication from scratch. packed_color_example_toadstorm.hip Edited March 5, 2019 by toadstorm misread earlier post Quote Link to comment Share on other sites More sharing options...
juleslin Posted March 5, 2019 Author Share Posted March 5, 2019 Thank you all for your prompt reply! I tried your suggestion and examples but I am not able to do what I need: This is the grass that I was mentioned, it's made of 60+ long grid. I applied material (shader with texture on diffuse) to it and packed. I created a grid and scatter points on it, gave it random color. I use copy to point to distribute the grass on the grid, the grass will collect the Cd from the scattered points. And I will use the Cd to multiply the mapping in the shader to have a better variation on grass. But I want to variation not only on each grass but on each grid of grass. (This is using the method provided by Midasssilver, it do the trick but it's not packed. I want to use pack to make the setup light and fast.) Sorry that I am not clear enough to describe my question before. And I hope I am not too stupid to find out the solution was already in the example that you guys provided... Thank you guys!! Quote Link to comment Share on other sites More sharing options...
Midasssilver Posted March 5, 2019 Share Posted March 5, 2019 (edited) You probably just need to re-pack it after it gets the right color, and make sure you promote the color when you re-pack it. Also, getting your color from the points that you are copying the instances of the plants onto doesn't help you, because you will need to overwrite it again with random color that takes every leaf into account. Edited March 5, 2019 by Midasssilver updated explanation Quote Link to comment Share on other sites More sharing options...
juleslin Posted March 13, 2019 Author Share Posted March 13, 2019 I tried repack them after the variation process, it works, just that it would took longer time to "prepare" before render. Thank you! Quote Link to comment Share on other sites More sharing options...
tmdag Posted March 13, 2019 Share Posted March 13, 2019 which Houdini version you are using? I remember 15 (?) did not support Cd on top of packed geo Quote Link to comment Share on other sites More sharing options...
simonhanart Posted December 8, 2021 Share Posted December 8, 2021 turn on Use Point Color and Use Packed Color inside of the Principled Shader Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.