Jump to content

HOT in MR for Maya


colt

Recommended Posts

Hi,

nice Toolkit.

I'm fooling around a little trying to get HOT working in a mental ray shader.

It looks good so far. Except for a big memory leak everything seems to be generated just fine.

The shader is really fast.

ocean01.jpg

movie

I compiled it with VS 2008 under Vista64 using the latest fftw. So it seems 64 bit windows works fine.

There's only one little problem. Since Mental Ray does the displacement first and calls the surface shader later, the normals and eigenvalues don't end up at their displaced position but instead at the original place, which makes them unusable.

I could do everything in uv space, since the uvs get displaced correctly, but I'd prefer world space, to be indepent of the underlying geometry.

Is there a way to get the displacement backwards? Like giving a point and finding out where it was before being displaced?

Or does anyone have any other ideas how to solve this?

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

nice Toolkit.

I'm fooling around a little trying to get HOT working in a mental ray shader.

It looks good so far. Except for a big memory leak everything seems to be generated just fine.

The shader is really fast.

ocean01.jpg

movie

I compiled it with VS 2008 under Vista64 using the latest fftw. So it seems 64 bit windows works fine.

There's only one little problem. Since Mental Ray does the displacement first and calls the surface shader later, the normals and eigenvalues don't end up at their displaced position but instead at the original place, which makes them unusable.

I could do everything in uv space, since the uvs get displaced correctly, but I'd prefer world space, to be indepent of the underlying geometry.

Is there a way to get the displacement backwards? Like giving a point and finding out where it was before being displaced?

Or does anyone have any other ideas how to solve this?

This is interesting, and very good. I'm wondering if you could maybe do this for a Regular Maya Shader that can be used across different Maya renderers (ie Mental Ray, Renderman...and so on). That would be REALLY great because, being mainly apart of the Maya community, we're always looking for an alternative to the Maya Ocean Shader (that doesn't render in Renderman because it's "Obsolete").

Link to comment
Share on other sites

  • 2 months later...

It's been some time but I didn't forget you. Basically there is no such thing as a "Regular" Maya Shader. Shaders have to be written and compiled differently for each renderer. The standard maya shaders are implemented for each renderer and under the hood maya(or the renderer plugin) uses the appropiate version, depending on what your rendering with. And I wouldn't call mayas ocean shader obsolete. In fact I quite like it. Just like the Tessendorf Ocean it's got a unique look wich sometimes fits better.

Anyway, I finished a version of HOT for Maya, so tada here it is:

ocean.jpg

download Maya 2008 32/64 bit Maya 2009 32/64 bit 2010 64bit, 2011-13 64bit .. all windows only

It consists of a mental ray shader and a maya deformer. This way you can setup your waves in the viewport with the deformer on a small plane and render them as displacement with the shader.

Thanks again to you Drew for the wonderful tool. I included the source. If you have any objections don't hesitate to inform me and I'll take this thing down. Else I'd like to spread it a little around the maya community.

Cheers, Nico

hot_deformer.jpg

Edited by colt
Link to comment
Share on other sites

Great work Nico, and I like the name of your tool :) As long as the source stays open I have no objection at all, in fact even if I hated the idea you are free to share your work, that's the beauty of open source!

Did you find any problems with the code ? I purposefully made Ocean.h completely independant of Houdini so that it would be straight forward to port to other renderers.

-Drew

.....

Thanks again to you Drew for the wonderful tool. I included the source. If you have any objections don't hesitate to inform me and I'll take this thing down. Else I'd like to spread it a little around the maya community.

Edited by eloop
Link to comment
Share on other sites

Did you find any problems with the code ? I purposefully made Ocean.h completely independant of Houdini so that it would be straight forward to port to other renderers.

Except for the one stated above (mental ray displaces first and then calls the shader again for coloration) just some small compiler issues. Using ocean.h is really easy, good work.

Too bad it's not reentrant safe, I had to thread lock the actual evaluation. Maybe giving the result right back when calling eval2_xz would be nicer.

Link to comment
Share on other sites

It consists of a mental ray shader and a maya deformer. This way you can setup your waves in the viewport with the deformer on a small plane and render them as displacement with the shader.

I understand that the plane is already generating a displacement...but is it possible to create an object level collision displacement based on certain objects being buoyant in the ocean? (ie a ball floating o the surface, and making SLIGHT ripples as it bounces)

Link to comment
Share on other sites

I understand that the plane is already generating a displacement...but is it possible to create an object level collision displacement based on certain objects being buoyant in the ocean? (ie a ball floating o the surface, and making SLIGHT ripples as it bounces)

The tessendorf ocean doesn't provide any tools for interactions, it's just a procedural system to generate wavelike surfaces. So you'll need to use Mayas tools on top of the ocean to get the desired effects.

The floating part should be doable using a constraint or some other Maya tool on the deformed ocean mesh. The interaction of the water could be done with a wave deformer, or even simulated using a fluid, which then further displaces the ocean (for this I plan on changing the shader so you can use multiple displacements)

Link to comment
Share on other sites

  • 2 weeks later...

Hi. I made a little update based one some suggestions and fixed some bugs. You can now layer multiple oceans/displacements.

But since I had to reorder some attributes your old files may not work anymore after the update, especially if you connected some inputs of the hotShader.

And I added compiles for 2008.

Same link as before:

download Maya 2008/9 32/64 bit

donGuzzi : You need a bigger sized ocean. The algorithm creates a wave pattern as big as the Size attribute and the repeats this. So if Size is only 10 meter in your scene scale you will see the tiles.

Don't forget to also increase the resolution to get enough detail into the bigger ocean.

  • Like 1
Link to comment
Share on other sites

But since I had to reorder some attributes your old files may not work anymore after the update, especially if you connected some inputs of the hotShader.

To avoid problems by reordering mr shader attributes it it always a good way to name the attributes with shortNames.

e.g.

scalar  "time" default 0, #:  softmin 0 softmax 100 shortname time # connect to time 

This way maya saves a connection like

connectAttr time1.outTime hotShader.time;

instead of

connectAttr time1.outTime hotShader.S6; -- or S1 or S0 or whatever

With named attributes you can later reorder and modify your mi interface file without problems.

Edited by haggi
Link to comment
Share on other sites

donGuzzi : You need a bigger sized ocean. The algorithm creates a wave pattern as big as the Size attribute and the repeats this. So if Size is only 10 meter in your scene scale you will see the tiles.

Don't forget to also increase the resolution to get enough detail into the bigger ocean.

----------------------------------------------------------------------------------------------------------

still need help

I took a scene from hotOcean_Maya\example\ ,and tried to tuned it.

this ocean was scaled to 1 000 000 in maya 2009

tnx

post-3196-125810235652_thumb.jpg

sceneMaya2009.rar

Link to comment
Share on other sites

Thanks Haggi. I always wondered what those were for.

I updated the mi files and examples accordingly, so everyone who downloaded last night please re-download.

donGuzzi: I was referring to the size parameter on the shader/deformer. For your scene try something like this:

Resolution 11

Size 15000

This will slowdown the scene and increase the needed memory but you are trying to fill a huge space.

Link to comment
Share on other sites

  • 3 weeks later...

Hello,ppl using this i want to make ocean having spray,mist,foam,etc.So,plz help me to do this.In default maya ocean it's easy to do using colorAtPoint cmd.But tell me here how to find velocity of particle in y axis emitting from hotOcean surface.

Method for Maya ocean

Velocity=currentParticleY position - colorAtPointAlpha

Link to comment
Share on other sites

  • 3 weeks later...

Hello,1 more question.In scene ocean is looking good but when i render it looks like repeat UV in texture..

Hello,ppl using this i want to make ocean having spray,mist,foam,etc.So,plz help me to do this.In default maya ocean it's easy to do using colorAtPoint cmd.But tell me here how to find velocity of particle in y axis emitting from hotOcean surface.

Method for Maya ocean

Velocity=currentParticleY position - colorAtPointAlpha

Link to comment
Share on other sites

  • 3 months later...

Hi Nico. I've got some issues with installation: don't understand where I'm doing wrong.

I put hotOcean.mi and hotOcean.dll in my custom lib and include folders (toghether with other shaders).

Then I put hotOceanDeformer.mll and libfftw3f-3.dll in a HOT subfolder inside my custom MAYA_PLUG_IN_PATH dir.

My .env file points to

MAYA_PLUG_IN_PATH = D:\Maya\2009\plug-ins;
                    D:\Maya\2009\plug-ins\HOT;

MI_CUSTOM_SHADER_PATH = D:\Maya\mentalray_Custom\include;

MI_LIBRARY_PATH = D:\Maya\mentalray_Custom\lib

Then I made a user PATH environment OS variable that points to;

D:\Maya\mentalray_Custom\lib;D:\Maya\2009\plug-ins\HOT

Then for the source, I really don't know what to do with those .cpp files..

I really look forward to use this awesome shader.

Link to comment
Share on other sites

Hi,

did you try loading the deformer plugin? Is it in the plugin manager? What is the error message? And do you see the shader in the hypershade? Is there an error when you try to render it?

Those source code files are for people who want to modify or recompile the shader for a different maya/ linux etc. You don't need them to run the shader. So just ignore them.

Nico

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