hi all.. is there any way to take a model with a displacement map appled and bake the displacement into the model so it can be worked on post displacement ?
basically applying the displacement map to the points so that it can be seen in the viewport.
thanks..
baking/freezing a displacement to polys
15089 19 3- MWainwright
- Member
- 119 posts
- Joined: July 2005
- Offline
- lucap
- Member
- 31 posts
- Joined: July 2005
- Offline
yep, just take the code from your displacement shader and put it into
a vex SOP, refer to the same texture map and you're set.
PS - your code may need a bit of tweaking, in the shading context the
global variables are in “world” space(ie the camera is the origin),
SOPs is in object space.
reply if you run into trouble.
Luca
a vex SOP, refer to the same texture map and you're set.
PS - your code may need a bit of tweaking, in the shading context the
global variables are in “world” space(ie the camera is the origin),
SOPs is in object space.
reply if you run into trouble.
Luca
- MWainwright
- Member
- 119 posts
- Joined: July 2005
- Offline
- jason_iversen
- Member
- 12672 posts
- Joined: July 2005
- Offline
You don't have the original source-code? If you do, change it from a displace mydisp() to a sop mydisp() and you'll compile a SOP with the same capabilities as the displacement shader.
Otherwise VOPs is an excellent alternative
Otherwise VOPs is an excellent alternative
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- rdms
- Member
- 201 posts
- Joined: July 2005
- Offline
- jason_iversen
- Member
- 12672 posts
- Joined: July 2005
- Offline
Ha! You are completely 100% correct - this is *exactly* what the BakeVex SOP is for, except that, unlike the viewport “VEX Shaded” mode, it only supports parameteric surfaces, and not polys.
Why? We rightly don't know, so we've kinda scrubbed BakeVex from being a truly useful operation since 95% of the time we're working with polys. :twisted:
Why? We rightly don't know, so we've kinda scrubbed BakeVex from being a truly useful operation since 95% of the time we're working with polys. :twisted:
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- rdms
- Member
- 201 posts
- Joined: July 2005
- Offline
jason_iversen
Ha! You are completely 100% correct - this is *exactly* what the BakeVex SOP is for, except that, unlike the viewport “VEX Shaded” mode, it only supports parameteric surfaces, and not polys.
Why? We rightly don't know, so we've kinda scrubbed BakeVex from being a truly useful operation since 95% of the time we're working with polys. :twisted:
Really? I could swear I just tried it on a polygonal sphere. Lemme go back and recheck.
Cheers,
Rob
Digital Supervisor | Stargate Studios Toronto
Rob
Digital Supervisor | Stargate Studios Toronto
- rdms
- Member
- 201 posts
- Joined: July 2005
- Offline
- MWainwright
- Member
- 119 posts
- Joined: July 2005
- Offline
jason_iversen
You don't have the original source-code? If you do, change it from a displace mydisp() to a sop mydisp() and you'll compile a SOP with the same capabilities as the displacement shader.
Otherwise VOPs is an excellent alternative
ah.. i thought the code from the type properties, which i cant get at in generic displace.. just the string from teh generic displace?
all i see is
“dmap map $HIP/textures/final_1024/octopus_tent_disp.tif amp 0.05 forpoly 1”
i dont know how to build a displacement in vops.. *looks*
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
Unfortunately there is no texture map function in Vop sop land.
Your best bet is to bring the image into cops and then use the pic or tex expressions to grab the luminance and then multiple the normal by this value and add it to the original position.
You can do this in vops or just a point sop.
Don't know why you can't access texture maps in vex sops.
Your best bet is to bring the image into cops and then use the pic or tex expressions to grab the luminance and then multiple the normal by this value and add it to the original position.
You can do this in vops or just a point sop.
Don't know why you can't access texture maps in vex sops.
The trick is finding just the right hammer for every screw
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
Simon
Unfortunately there is no texture map function in Vop sop land.
In the SOP context, you can access images (from disk or from inside the session via the ‘op:’ syntax) using the colormap() or rawcolormap() functions. One of the colormap() variants is available as the Colormap VOP.
In general, any operation whose functionality depends on derivative information (like the shader-side texture() shadeop or any anti-aliasing op) will not make sense in the SOP context, since this info is not available there. In a lot of cases the self-antialiasing functions (like all the various noises) will simply default to some very small area measure and carry on (essentially point-sampling). But even that may not make sense in some contexts so the function won't exist there.
This is why you won't always be able to get away with a simple copy/paste. But you can still duplicate functionality – just keep in mind that there's no “area sampling” in SOP land.
Cheers!
- peliosis
- Member
- 175 posts
- Joined: July 2005
- Offline
Hello spaceboy,
I created an example of what I learned yesterday (watching VOPS video tutorials which are great)a little scene, that I hope will work
Basically it's a grid displaced (with a SOP) and textured with mandril.pic
Write back if it works.
cheers
Peter
—edit
Ok, it works now, rightclick saveas and delete the.htm suffix
—edit
http://www.piotrtwardo.neostrada.pl/pelio_texturedispSOP.hipnc
I created an example of what I learned yesterday (watching VOPS video tutorials which are great)a little scene, that I hope will work
Basically it's a grid displaced (with a SOP) and textured with mandril.pic
Write back if it works.
cheers
Peter
—edit
Ok, it works now, rightclick saveas and delete the.htm suffix
—edit
http://www.piotrtwardo.neostrada.pl/pelio_texturedispSOP.hipnc
Edited by - May 19, 2005 12:46:14
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
Mario Marengo
In the SOP context, you can access images (from disk or from inside the session via the ‘op:’ syntax) using the colormap() or rawcolormap() functions. One of the colormap() variants is available as the Colormap VOP.
Colormap Vop that's the one - thought it was weird that there wasn't any way to access textures in vops.
SESI If you click on colormap in the vex quick reference html file the link is broken by the way.
The trick is finding just the right hammer for every screw
- lucap
- Member
- 31 posts
- Joined: July 2005
- Offline
because you can't get at the code from “generic displace” have a lookat the
code in “Vex Displace Map” you should be able to access this via the type properties.
and as Mario says use colormap() instead of texture
thanks for pointing that out Simon, I just had a look in 8.0.233 and it looks like it's fixed.
all the best
Luca
code in “Vex Displace Map” you should be able to access this via the type properties.
and as Mario says use colormap() instead of texture
SESI If you click on colormap in the vex quick reference html file the link is broken by the way.
thanks for pointing that out Simon, I just had a look in 8.0.233 and it looks like it's fixed.
all the best
Luca
- MWainwright
- Member
- 119 posts
- Joined: July 2005
- Offline
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
Weelllll, the “correct” way if there is such a thing would be to write a sop in vops using the rawcolormap() vop. Basically copying the code from the current vex displace shader. But you can hack round it using a point sop and an expression or two if you are more familiar with them and don't like the idea of getting your hands dirty in vex/vops. The vop way will cook quicker but for a small mesh you won't noticed the difference.
The trick is finding just the right hammer for every screw
- Siavash Tehrani
- Member
- 729 posts
- Joined: July 2005
- Offline
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
- the_squid
- Member
- 132 posts
- Joined: July 2005
- Offline
One way to do this is by setting up a simple SOP network that reads an image and apply's point color information to points, and then uses that point color information to displace points in a pointSOP.
In COPs, append a fileCOP and source your displacement image there. In my case I called this node “displace_file.”
In SOPs, take the geometry you're wanting to displace and append a pointSOP (after your UV's have been projected). In the point SOP, you're going to adjust your position by overriding the default $TX,$TY,$TZ with:
$TX+(pic(“/img/img1/displace_file”,$MAPU,$MAPV,D_CLUM)*$NX)*1
$TY+(pic(“/img/img1/displace_file”,$MAPU,$MAPV,D_CLUM)*$NY)*1
$TZ+(pic(“/img/img1/displace_file”,$MAPU,$MAPV,D_CLUM)*$NZ)*1
“D_CLUM” will take the luminance value of your image and use that to apply the displacement.
If you want more help on this function, open a textport and type:
exhelp pic
Notice I multiply the pic() function by $NX,$NY,$NZ. This should point the displacement in the direction of the normals. The multiplier at the end sets the amount of displacement.
This method will not necessarely duplicate the exact kind of displacement you're getting through the shader but should help with as an aid in visualization.
In COPs, append a fileCOP and source your displacement image there. In my case I called this node “displace_file.”
In SOPs, take the geometry you're wanting to displace and append a pointSOP (after your UV's have been projected). In the point SOP, you're going to adjust your position by overriding the default $TX,$TY,$TZ with:
$TX+(pic(“/img/img1/displace_file”,$MAPU,$MAPV,D_CLUM)*$NX)*1
$TY+(pic(“/img/img1/displace_file”,$MAPU,$MAPV,D_CLUM)*$NY)*1
$TZ+(pic(“/img/img1/displace_file”,$MAPU,$MAPV,D_CLUM)*$NZ)*1
“D_CLUM” will take the luminance value of your image and use that to apply the displacement.
If you want more help on this function, open a textport and type:
exhelp pic
Notice I multiply the pic() function by $NX,$NY,$NZ. This should point the displacement in the direction of the normals. The multiplier at the end sets the amount of displacement.
This method will not necessarely duplicate the exact kind of displacement you're getting through the shader but should help with as an aid in visualization.
- brucelay
- Member
- 313 posts
- Joined: July 2005
- Offline
-
- Quick Links