Jump to content

Random color to instanced objects (Stars)

Recommended Posts

Hey Guys,

I'm very new to Houdini so this is likely a basic question. I'm trying to create a background of stars for an eventual nebula scene and I'm having trouble randomizing the color on my instanced stars and am not sure if I am approaching the problem correctly.

I have created a sphere and converted to fog VDB using 'VDB from Polygons' --> this is my basic star shape.

I have then instanced it onto points scattered onto very large spheres which encompass my scene, for this I used 'copy to points'.

By using an attributevop I was able to randomize the pscale of my points and this was successfully inherited by my instanced objects, however I have not been able to do the same with Cd. 

I have tried playing with Cd in attributevops and volumevops as well as trying to use Cd in my material shaders for the volume color (I am using pyro shader and have also tried volumeshader as well).

If you guys could point me in the right direction it would be very appreciated!


I'm also curious about other methods you guys have used to create stars in houdini if you feel like sharing!





pscale and Cd.png

Material Setup.png


Edited by GhostRuckus
Fixed image of stars from alpha to black background

Share this post

Link to post
Share on other sites

First, it's a very good idea to include your .hip file when you're having trouble.

Second, your setup should work. You might be suffering from the oldest bug in Houdini: the viewport not updating. Usually closing the Scene Viewer and opening again fixes it.

Here's a hip, just for demo.





Share this post

Link to post
Share on other sites

Thanks so much Vitor! At least I know my approach is correct. I think my issue is with the fact that i'm using a volume shader on the instanced volume which does not seem to be picking up the inherited Cd? I tried refreshing the viewport but it does not seem to work.  I have attached the .hip file.



stars example.hip

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now