Jump to content

GU_Fur how to pass the cvex shader?


Recommended Posts

Hi there, this is my first at forum, so big thanks to any feedback anyway.

 

I built simple standalone program using HDK and GU_Fur class (that if I understood just a C++ wrapper around Fur SOP and Fur mantra Procedural). You can find  it at GU_Fur.h.

Everything worked great, i can pass any surface geometry, change "Fur SOP" parameters and, get fur geometry very easily. I can guess this way we can build things like Renderman Fur DSO or other renderers DSO's at no time.

 

Except one fact: i cannot find a way how we can pass cvex guide shader and skin shaders to our SOP wrapper. Its excepts UT_String, but since there is not docs about it at all, and I can only just try things. I can guess that this wrapper only work in Houdini GUI or mantra environment and can access shaders only using "op:$shoppath $params" syntax, because that thing spits warning "Cannot load guideshader" if i pass something to it this way. That also happens if pass shader code (trying both source and compiled) to it.

 

BUT! if pass shader path to existing compiled vex file, there is no warnings at all! But my little piece of software crashes when i call generate method! I dont know if its due to my vex shader ( I doing simple example with sphere and get shader code from FUR OBJ native to Houdini), or I doing something wrong, or it is some Houdini bug (I working with latest stable build).

 

Any suggestions, or idea is appreciated.

 

Link to comment
Share on other sites

Update:

I tried to wrap my code as SOP node to see if its context issue. And you know what? If we i pass "op:$shoppath $params" syntax with shoppath be path to existing cvex shader builder node everything working! Major change that i did is passing to GU_Fur generate method the current sop node  as valid UT_OpCaller using OP_caller(this) code. I imagine this is why that syntax is working and my node can find shader.

But thats not resolving the issue in any way => i cannot do this in standalone mode since I dont have any nodes there.

 

Also i tried to play with mantra fur procedural at IFD stream, see what syntax its supports at guideshader and skinshader parameters. While by default its exports "op:$shoppath $params" syntax, 

mantra fur procedural also support full_path to compiled VEX file. It is explain why its crashing without warnings in my standalone mode =>Its trying to do something!

 

Buy if i tried to force compiled VEX shader path in my "working" SOP test ... and got same result=>houdini crashes.

 

Again it would be awesome if anyone add something to thread.

 

Link to comment
Share on other sites

I'm shooting in the dark but I think you may have the same issue with op syntax like IFD generation

 

Thanks for reply. 

 

Its even simpler, I found my stupid mistake!

 

Just in case if someone will read it, We (not just me,  cause I already asked friends for help) were thinking:

1) It was something wrong with UT_OpCaller we need to implement

2) Documentation  says that we need to use MOT_Director if we want to use CVEX in standalone apps. And call static MOT_Director::installFullCVEX() . Thats not possible since there is no(!) such function in header file. We tried to create MOT_Director object anyway. It wasnt any real help.

3) I was thinking it was something related to threading, since i have some combination of simple  compiled shaders(!) and one(!) face of geometry working(!). That was frustrating since you thinking you there but you are not.

 

Take a look at function. 

// creates curves in 'gdp' grown from the primitives specified by
// 'skinprims' from the skin geometry used in the constructor
void generate(UT_OpCaller *caller,
                 GU_Detail *gdp,
                  const UT_IntArray &skinprims,
                  fpreal display,
                  bool use_closest_clump,
                  bool remove_unclumped,
                  GU_FurCurveType type,
                  GA_AttributeOwner skinowner,
                  GA_AttributeOwner guideowner,
                  bool interruptable);

GA_AttributeOwner  enum support several values like GA_ATTRIB_VERTEX, GA_ATTRIB_POINT, GA_ATTRIB_PRIMITIVE and etc. BUT in houdini native FUR SOP  gui,  guides attribute type parameter supports only vertex and points.

 

But in my app i just hardcoded guideowner to GA_ATTRIB_PRIMITIVE, so i changed that to GA_ATTRIB_POINT and thats it ! It works!

 

P.S.

I can share simple standalone source code to play with if someone interested ?

Edited by xeash
Link to comment
Share on other sites

Guest mantragora

I can share simple standalone source code to play with if someone interested ?

Yeah, just add some info what it does. Example without info is the same like reading documentation ;)

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