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!

 

 

 

Setup.png

pscale and Cd.png

Material Setup.png

stars.png

Edited by GhostRuckus
Fixed image of stars from alpha to black background
Link to comment
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.

 

 

 

random_colors_odf.hip

Link to comment
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.

 

Thanks!

stars example.hip

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...