Jump to content


HOT in MR for Maya


  • Please log in to reply
41 replies to this topic

#1 colt

colt

    Peon

  • Members
  • Pip
  • 10 posts
  • Joined: 08-August 09
  • Location:Germany
  • Name:Nico Rehberg

Posted 08 August 2009 - 01:19 PM

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.

[img]http://http://www.gruppe-weimar.de/nico/temp/ocean01.jpg[/img]

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?

#2 CodeBreak

CodeBreak

    Peon

  • Members
  • Pip
  • 28 posts
  • Joined: 21-July 09
  • Location:Michigan
  • Name:Brandon Moner

Posted 17 August 2009 - 12:38 PM

View Postcolt, on 08 August 2009 - 01:19 PM, said:

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.

[img]http://http://www.gruppe-weimar.de/nico/temp/ocean01.jpg[/img]

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").
If I don't give too much information, if I don't go there, it's like I was never "there" in the first place.

#3 colt

colt

    Peon

  • Members
  • Pip
  • 10 posts
  • Joined: 08-August 09
  • Location:Germany
  • Name:Nico Rehberg

Posted 22 October 2009 - 01:12 PM

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:

Posted Image


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

Posted Image

Edited by colt, 06 January 2013 - 01:40 PM.


#4 CeeGee

CeeGee

    Illusionist

  • Members
  • PipPipPip
  • 309 posts
  • Joined: 15-July 07
  • Location:Belgrade - Srbija
  • Name:Igor Zanic

Posted 22 October 2009 - 02:01 PM

colt great work,

Very good and realy fast plugin i just test it in maya grid divade 750*750 frame/second

thanks alot...

Edited by CeeGee, 22 October 2009 - 02:16 PM.


#5 eloop

eloop

    Illusionist

  • Members
  • PipPipPip
  • 260 posts
  • Joined: 29-January 03

Posted 23 October 2009 - 02:48 AM

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

View Postcolt, on 22 October 2009 - 01:12 PM, said:

.....
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, 23 October 2009 - 02:49 AM.


#6 colt

colt

    Peon

  • Members
  • Pip
  • 10 posts
  • Joined: 08-August 09
  • Location:Germany
  • Name:Nico Rehberg

Posted 24 October 2009 - 09:48 AM

View Posteloop, on 23 October 2009 - 02:48 AM, said:

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.

#7 CodeBreak

CodeBreak

    Peon

  • Members
  • Pip
  • 28 posts
  • Joined: 21-July 09
  • Location:Michigan
  • Name:Brandon Moner

Posted 26 October 2009 - 06:52 AM

Thank you so much for this. Exactly what I needed to take things to the next level in Maya. CHEERS!
If I don't give too much information, if I don't go there, it's like I was never "there" in the first place.

#8 CodeBreak

CodeBreak

    Peon

  • Members
  • Pip
  • 28 posts
  • Joined: 21-July 09
  • Location:Michigan
  • Name:Brandon Moner

Posted 26 October 2009 - 09:38 AM

View Postcolt, on 22 October 2009 - 01:12 PM, said:


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)
If I don't give too much information, if I don't go there, it's like I was never "there" in the first place.

#9 colt

colt

    Peon

  • Members
  • Pip
  • 10 posts
  • Joined: 08-August 09
  • Location:Germany
  • Name:Nico Rehberg

Posted 27 October 2009 - 10:36 AM

View PostCodeBreak, on 26 October 2009 - 09:38 AM, said:

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)

#10 Starrider

Starrider

    Peon

  • Members
  • Pip
  • 12 posts
  • Joined: 25-March 08
  • Location:Frankfurt
  • Name:Daniel Stern

Posted 04 November 2009 - 06:00 AM

Hey!
I'd be really interested to try it but the download link is not working anymore.
Is it still available?
Thanks

Ohohoh. I just realized it's working now. Sorry for wasting posts. :)

Edited by Starrider, 04 November 2009 - 06:03 AM.

-------------------------------------------
www.technicaldirector.de

#11 djwarder

djwarder

    Peon

  • Members
  • Pip
  • 48 posts
  • Joined: 18-August 09
  • Location:London, UK
  • Name:Dan Warder

Posted 04 November 2009 - 08:15 AM

Great news, can't wait to play with HOT in Maya!!  Any chance it could be recompiled for Linux tho?

No matter, I just took the Loki & Windows-specific bits out and it compiles fine!!  ;)

Edited by djwarder, 05 November 2009 - 02:29 AM.


#12 donGuzzini

donGuzzini

    Peon

  • Members
  • Pip
  • 2 posts
  • Joined: 17-October 07
  • Location:Saint-Petersburg, Russia
  • Name:Yegor Lavlinski

Posted 12 November 2009 - 12:28 PM

Hello,
i have a porblem with wave tiling in maya.
Give me advice.


-----------------------
best regards
Yegor, Russia, Saint-Petersburg

Attached Files






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users