Sikorskiy

Sikorskiy

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Looking like a water Aug. 25, 2008, 9:09 a.m.

Hi

I want to make my surface in Houdini to look like a real water, but I don't know what shaders (or smth.) I can use for it.

My surface is built by isosurface node from file. All I can do now is to make it to look like a plasticine Here I used just a “chrome” material, but it looks very bad.

Help me, please.

Writing the expression function Aug. 18, 2008, 9:46 a.m.

edward
You could use a static object that only gets allocated upon the first function call.

eg.
MyClass *getMyObject()
{
static MyClass *my_object = NULL;
if (!my_object) my_object = new MyClass;
return my_object;
}


Or, if you want to guard against concurrency as well take a look at UT/UT_DoubleLock.h.

Yeah. Thank you. It's a good idea.

That's ok. I've used not static, but global variable.

Writing the expression function Aug. 15, 2008, 3:51 p.m.

Antoine Durr
What you'd have to do is when your function is called, check to see if this structure exists externally. If not, create it; if it does, use it. However, this can be very inefficient, as your function could be inside an inner loop getting called 100's of times.

You might want to rethink the problem a bit, and have some OTL or python function create the external structure. The Houdini paradigm is that any external file that you create should be recreateable at will, e.g. a geometry file, or an image file, a voxel file, etc. Maybe create a ROP that writes out the data first, so that the user can restart from the beginning.

I'm a bit surprised that you're delving into the HDK at this early stage. There have been ever fewer reasons to go that deep, especially with the introduction of Python into H9.

Thank you so much. You're very kind.

I succeeded with this task. CMDextendLibrary() acts as main(). This function is called when Houdini starts and there I create my structure. And in my callback function I'm just using it. A disadvantage is that the structure is created each time, when Houdini starts (and if I don't want to use my expression function in the project). And it's inefficient. But it works


And about Python. I'm not familiar with this language. I know C++ and I have some experience. But I don't know Python at all. So, I decided, that C++ way would be easier.


Thank you one more time for your advice.