Jump to content

Point Cloud To Point Shaded Fall Off


aracid

Recommended Posts

Hey all

I'm busy rendering some crowds using massive and im trying to optimise the ground ambient occlusion, so what im thinkin is taking the amc out of massive, converting that into a point cloud, and then rendering that with some sort of fall off based on the distance between the surface being shaded to the point in the points cloud. using mantra :-)

so this is the render i get using air and the ground ambient occlusion,

post-585-1173367149_thumb.jpg

what looking for is this

post-585-1173367252_thumb.jpg

the blue being the point out of the point cloud.

I thought this would be a simple solution in theory

post-585-1173367494_thumb.jpg

and it works close to where the centre of the scene is, however

but i keep on getting this - notice how the fall off dissapears further away from the scene origin.

post-585-1173367539_thumb.jpg

i'M trying to achieve some way of looping though the points that are nearest to the one being shaded and Maxing Cd and not ending up with this

post-585-1173367640_thumb.jpg

;)

so if anyone can shed some light on this for me, I'd really appreciate it.

heres the hip file that i used to generate the problem.

odforce.rar

thanks again

brian

Link to comment
Share on other sites

I created a shader that will do what you want... or at least I think it does something

close to what you're after.

I can't stand using looping/if statements in vops so i wrote it with vex.

Check the operator type properties' "vex code" tab for details.

let me know if you have any questions.

L

doc_fast_ao.otl

Link to comment
Share on other sites

I'd post a hip, but the way things are set up here at work we can't embbed otls.

How do they do that? I know they can make it so that it nevers saves the "Save Embedded OTLs" option, but you should always be able to turn it back on after you start Houdini prior to saving your .hip file?

Link to comment
Share on other sites

Hey Ed,

This is how it's done: hopmanager.pref.nosave & it's a show wide setting so all the options are locked to prevent accidentally change.

However, we can source houdini_setup in a standalone shell without the show environment variables which will allow us to embed HDAs into the hip file.

Cheers!

steven

Link to comment
Share on other sites

However, Luca can source houdini_setup in a standalone shell without the show environment variables which will allow him to embed HDAs into the hip file. He just forgot about that, I'm sure. ;)

Nope, just lazy :)

Link to comment
Share on other sites

What is the difference between your shader and a sprite attached to each point, where the sprite is a radial falloff ?

As I understand the source, you are reading the point cloud like a texture file?

How do you know that bgeo files can be used as texture files?

Georg

Link to comment
Share on other sites

Hey doc, thanks for the updated version,

this one is exactly what im looking for :-)

What is the difference between your shader and a sprite attached to each point, where the sprite is a radial falloff ?

Georg

I havent actually tried that solution :)

and yeah, basically what doc's done is measured the point on the surface being shaded to the closest point cloud, which basically returns something similar to the second pic on the post.

With this method im hoping that it might give less problems when the terrain isnt flat and u end up with a sprite that over laps the edge or penetrates the geometry.

:blink:

Link to comment
Share on other sites

  • 1 month later...
Hey doc, thanks for the updated version,

this one is exactly what im looking for :-)

I havent actually tried that solution :)

and yeah, basically what doc's done is measured the point on the surface being shaded to the closest point cloud, which basically returns something similar to the second pic on the post.

With this method im hoping that it might give less problems when the terrain isnt flat and u end up with a sprite that over laps the edge or penetrates the geometry.

:blink:

I took the liberty of rebuilding doc's shader in VOPs (more for an exercise - neither I like the way 'for's and 'while's look in VOPs). So here's the shader - it works 'almost' like doc's and I am not sure whether it's me or the way VOPs are supposed to work, nevertheless I can't really tell why they do work this way. Reading the code of a network explains much, except why it was done to work exactly like such... Maybe somebody is more successful in exploring this 'terre inconnue'

doc_ao_vops.rar

Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...
Hey guys

is it just me, or does this scene file not work in H9?

has anyone tried anything similar?

I'm trying to get this working too. Doc's code works fine but I need to get a node based version working. We had a simnilar network working in H8 but in 9.1.145 it isn't.

J

Link to comment
Share on other sites

I tried the node based vops version in a recent build of Houdini. After saving the scatter sop as a bgeo and packaging the shader into a material (and replacing the shader sop with a material sop), everything looked like it was working well. What specific problems are you all having with it, at what step is it not working?

I'm trying to get this working too. Doc's code works fine but I need to get a node based version working. We had a simnilar network working in H8 but in 9.1.145 it isn't.

J

Link to comment
Share on other sites

How do they do that? I know they can make it so that it nevers saves the "Save Embedded OTLs" option, but you should always be able to turn it back on after you start Houdini prior to saving your .hip file?

I think all large facilities end up disabling embedding and locking the prefs with the .nosave Steven mentions.

However, you can still go to the Operator Type Manager using the RMB "Copy" function, copy the operator type not to another external OTL file but instead to "Embedded". This will embed the HDA into the hipfile. (IMHO the Operator Type Manager should publicize this capability somehow - perhaps with a "Embed this Operator Type" toggle alternative to the string field)

You can also use a script to embed all your OTLs, taking care not to embed OTLs shipped with Houdini:

set ots = `execute("otinuse -t")`

foreach ot ($ots)
  set original_otl = `execute("otgetotl $ot")`
  if( "$original_otl" != "Embedded" )
	if( `strmatch("${HFS}*","$original_otl")` == 1 )
	  echo "$ot is part of the houdini distribution. ($original_otl)"
	else
	  echo "embedding operator type ($ot) from ($original_otl)"
	  otcopy $ot Embedded
	  #otprefer $ot Embedded  # prefer it if you like..
	endif
  endif
end

Link to comment
Share on other sites

I tried the node based vops version in a recent build of Houdini. After saving the scatter sop as a bgeo and packaging the shader into a material (and replacing the shader sop with a material sop), everything looked like it was working well. What specific problems are you all having with it, at what step is it not working?

I've attached the file i'm working with. If it works for you then I'm at a loss. I've also tried building it from scratch without much result and also with a for loop instead of a while loop but I'm not getting very far with it.

John

doc_ao_vops_H9_edit.rar

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...