CinnamonMetal Posted September 30, 2018 Share Posted September 30, 2018 Hopefully someone can help. How do I transform from point space to shader space. I'm attempting to translate a RSL to VOPS and I'm using the transform VOP to go from the current position, but do not know how to take the current position and transfer to the shader position ? Quote Link to comment Share on other sites More sharing options...
anim Posted September 30, 2018 Share Posted September 30, 2018 default space in surface shader context like is camera space so space:current means camera space also all Global Variables are in camera space, so P is already in camera space if you want your P in world space, just connect it to Transform VOP and set From Space to space:current and To Space to space:world, etc. Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted September 30, 2018 Author Share Posted September 30, 2018 @anim I want shader space ? Camera space, is different from shader space. Quote Link to comment Share on other sites More sharing options...
anim Posted October 1, 2018 Share Posted October 1, 2018 What do you call shader space? UV tangent space? Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 1, 2018 Author Share Posted October 1, 2018 (edited) @animThat is what I'm trying to figure out; my guess is yes, shader space is UV tangent space. I'm attempting to convert this code into SHOP. color baseColor= color (0.56,0.6,0.41); float baseColorFreq = 2; float label = 0.5; } /* Transform P from "current" to "shader" */ point Pshad = transform("shader", P) * baseColorFreq + label; Although the grid which this shader is applied on, still remains white; rather then the BaseColor parameter which is 0.6,0.65,0.12 ? Shader Space is BxDF, I assume the Transform VOP must be set `out` to `space:light` unless I can convert to BxDF ? Edited October 1, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 2, 2018 Author Share Posted October 2, 2018 What does a surface shader mean in terms of renderman ? Quote Link to comment Share on other sites More sharing options...
anim Posted October 2, 2018 Share Posted October 2, 2018 (edited) I don't think it's very important, but it's definitely not UV tangent space, seems like it's a traditional coordinate system defined by the shader, I don't think Mantra has that, but you can use any object as such coordinate system if you need to share it among all objects using that shader, or if it works for you use 'object' or 'world' or define 'rest' attrib and use that directly as Pshad what's important though is to connect your VOPs correctly, Pshad is not a parameter, it's simply the output value of add1, the input to transform1 is supposed to be P from Global Variables, and you have to multiply with baseColorFreq not baseColor as you are computing Pshad, which is a coordinate that you will use later to sample some 3d procedural pattern which you will multiply with actual baseColor if you want. In other words baseColorFreq is the float multiplier or scale of your space and can be thought as a frequency of the pattern, baseColor is actual color Edited October 2, 2018 by anim Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 2, 2018 Author Share Posted October 2, 2018 (edited) Are you saying to create a parameter with the name as @P and plug it into the `from` of the transform VOP, or simply set the `fromSpace` within the transform VOP to @P ? After I add the Label and the multiple, I then would multiply pShad with the baseColor and plug that into the color of pbrDiffuse ? Edited October 2, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 9, 2018 Author Share Posted October 9, 2018 (edited) From my understanding the Rest VOP prevents swimming, correct ? Whether @animor someone else; this is the first step I'm trying to achieve. I want to multiply the shading point by the parameter baseColorFreq. Then I want to add the parameter label to this transformation so that you can use the same shader to create unique patterns; although I'm not getting a color on my grid, therefore I'm completely stuck ? BTW @anim reputation is approved by the devil. Edited October 9, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
anim Posted October 10, 2018 Share Posted October 10, 2018 which patterns are you trying to create? rest or P or uv can act as coordinate input for the pattern, whether you take the coordinate value as it is or transform to different space depends on what you need rest is usually static position value in local object space, it will prevent swimming as long as the values don't change during the animation, transforming it to different space however may itself introduce swimming if that space is changing in relation to space you are transforming from, so I wouldn't recommend combining rest with transform, just use rest, or for already static geo just transform P to object space to actually get your pattern to show plug your coordinate (P, rest, uv) to some pattern generator like noise or other and then multiply with color and connect to diffuse Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 10, 2018 Author Share Posted October 10, 2018 @animWhat I want to know first; why can't I get a color applied to the grid. The baseColor is a parameter Vector, as we know color is a vector; why isn't the grid which I have in the viewport colored based on the float values for the BaseColor parameter ? You can reference my previous post for the network. Quote Link to comment Share on other sites More sharing options...
anim Posted October 10, 2018 Share Posted October 10, 2018 (edited) from what I see you are adding 2 after you multiply with the color and 2 is way over one and since one is white x + 2 is most likely white if x was somewhere around -1..1 so I wouldn't be surprised if you are seeing white also rest can have any values so it's also possible to have way negative values, that after multiplying with positive color is still negative and +2 can still be <0 and you may be seeing black so there is no telling from the screenshot if the values are expected or not, just fit to the whole range in MPlay or RenderView to see if you are getting any values or not, and it's better to preview just output of certain nodes to directly inspect their values Edited October 10, 2018 by anim Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 10, 2018 Author Share Posted October 10, 2018 @animHow do I fit to the whole range in MPlay or Renderview ? The original code; point Pshad = transform("shader", P) * baseColorFreq + label; Therefore if point is the point position named Pshad and transform is the rest position within Houdini vops, and I have to multiple the baseColorFreq by the rest position followed by adding that to the label, I should be getting not white but a color ? If I disabled the multiple or add vops, I'm still only getting white ? 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.