Home Technical Talk

[Maya 2009] how to render an environment map?

polycounter lvl 14
Offline / Send Message
sama.van polycounter lvl 14
Plop plop!


I would to know if someone has a good reference or quick explanation about rendering an environment map in Maya...

I checked the Polycount-Wiki in the cube map section but there is no line about it :(

- http://wiki.polycount.com/CubeMap?action=show&redirect=Cube+Map

The Maya documentation doesn't have a chapter about it :

- http://download.autodesk.com/us/maya/2009help/index.html

Youtube same :

- http://www.youtube.com/results?search_query=environment+map+maya&suggested_categories=1%2C20&page=1


I finally found this tutorial :

- http://www.creativecrash.com/maya/tutorials/rendering-lighting/general/c/create-your-own-hdr-environment-map-in-maya-mental

But I do not success to make it work with a new scene or from the scene example =_=.


Maybe I do not do the right research but what I am trying to do is to bake a 3D environment on a sphere (or cube), creating a skybox of my 3D level ^_^/


Thanks!

(And if I success to find a solution I will provide tutorial page for the polycount wiki about it!!)

Replies

  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    you can render a cube map easily with 6 cameras at the center of your scene with 90deg field of view (?) you can stitch the 6 squares together in a program like ATI's cubemapgen

    as for latlong env maps the best option is to use a lens shader that will do the work for you - like the one you linked in your post
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    problem with the latlong env maps is I am getting the following error :
    Warning: (Mayatomr.Custom) : C:/Program Files/Autodesk/Maya2009/mentalray/include/latlong_lens.mi: couldn't find shader library
    API  0.0  error  301031: call to undeclared function "latlong_lens"
    Warning: (Mayatomr.Scene) : output data type "rgb_fp" not directly supported by image format hdr, conversion performed by mental ray
    API  0.0  error  301032: while defining camera "latlong_cameraShape": undefined shader "latlong_lens"
    

    I do not understand because I installed it correctly and the shader appears in the list and once created it looks correct in Maya.


    And at the maya's startup I have the following shout :
    // parsing C:/Program Files/Autodesk/Maya2009/mentalray/include/latlong_lens.mi
    // loading C:/Program Files/Autodesk/Maya2009/mentalray/lib/latlong_lens.dll
    // generating Maya nodes...
    

    The cube map solution is not the best for me because for iPhone and I would like the save the maximum space on my texture. Then spherical render should give better result for performance!


    Did you already tried the tutorial and successed to make it works? :(
    It takes about 10 min to do it... and to see if it works... :)
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    ok.......

    - http://forums.cgsociety.org/archive/index.php/t-588030.html
    figure it out. it does not support 64 bit maya


    it's great =___=.
  • badmouse
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    url look cool!

    I first tried that one :

    - http://fc02.deviantart.net/fs27/f/20...a_by_fYuri.jpg

    But after my afternoon or work I understand I cannot use it if I am using things like environnement physical fog.

    Now I would like to try the JS_Panorama from http://www.pixero.com/downloads_mr.html but I do not understand how I am supposed to use it...

    I installed it, added it to my scene, but after what I am supposed to do with that? O_o..

    Does someone know?
  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    you plug it into the cameras mental ray > lens shader slot
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    yes sure I did O_o...

    Look, I did a movie, and you can watch my process from the install to the rendering.

    Maybe I miss a step, or did something wrong...

    Video length is about 5 min to do everything.
    (YouTube is encoding the HD version on the main page if you want a better resolution!)

    [ame]http://www.youtube.com/watch?v=jCuq7Yk8fpI[/ame]
  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    the shader is a mental ray shader, you must render with mental ray - in the video you try to render with maya software. I just tested this out and it works as expected.
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    Yes but no! T_T It doesn't work.

    It gives a black screen with the shader.
    But if I delete the node in Maya, the basic render with the camera is ok...
    Then I do not understand why I have a black screen wit the shader O_o

    Do you still have your .ma scene I can try it out my Maya?
    Maybe there is a problem of scale or something?

    Look I made another short movie (45s) :

    [ame]http://www.youtube.com/watch?v=uU87gOatzEI[/ame]
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    Oh....

    I didn't see it first but I have the following error at maya startup :
    // parsing C:/Program Files/Autodesk/Maya2009/mentalray/include/JS_panoramic.mi
    // error (line   20): syntax error, unexpected T_STRING
    // loading C:/Program Files/Autodesk/Maya2009/mentalray/lib/JS_panoramic.dll
    // Warning: (Mayatomr.Nodes) : Node "JS_panoramic" has no ID, assigning a temporary ID. Scene should be saved as .ma (ASCII). //
    


    And a firend just tried with my video and render with mental ray under maya 2010 and it works... but once I try with his scene from maya 2009 I have the same error...

    There is the source of the plug in in the download file, I will try to compile a new version it for maya 2009. It could be the issue...
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    I got in touch with the JS_Panoramic plug-in creator and to delete the ID problem he sent to me new file.

    In the JS_panoramic.mi file just add a new line after ) on line 36 with :
    #: nodeid 7777072 # Node ID for binary Maya files
    

    He also explained the plug-in could create some error on OS 64 bits...
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    Last message to say I tried the plugin under Maya 2009-32 bit and it works.

    Butthe JS_Panoramic is not really for game use if you want to apply the render to a sphere in your game.
    This is not cool because Bake option do not allow rendering special effect X_X

    MRToDelete.jpg
  • ivars
    Offline / Send Message
    ivars polycounter lvl 15
    If I understand the question correctly, tthere's a way to do this using "transfer maps". Don't have maya on this computer, but I'll try to throw a little tut together tomorrow.
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    ivars wrote: »
    If I understand the question correctly, tthere's a way to do this using "transfer maps". Don't have maya on this computer, but I'll try to throw a little tut together tomorrow.

    Oh thanks!

    But MR bake method do not allow me to use things like caustic effect, physical fog, etc... when rendering.
    then it should be same for transfer map method? what do you think?
    I will do some test on my side to.
  • ivars
    Offline / Send Message
    ivars polycounter lvl 15
    Aha, I see. Yes, it appears to be the same problem.
    I did have some luck using a reflective MR material as a custom shader, (it rendered my caustics) but as soon as I use it my search rays seems to get all fucked up or something....
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    yup that's right...

    Then caustics on a Layered shader on all my objects...
    Light and ray effects on simple planes as school method...
    And cool fog done under photoshop :)

    It's the current deal! ^_^
  • Whargoul
    Offline / Send Message
    Whargoul polycounter lvl 18
    What I did back in the old days (SSX1) for the cubemaps was to render a sphere.

    Put a nurbs sphere (or highly divided poly one) in the scene, make a perfectly black reflective mirror material on it - frame it up super tight and render it. Boom - %99 perfect spheremap.

    Whatever materials and all that - if they show in refletions, they'll show in the refmap.
  • Whargoul
    Offline / Send Message
    Whargoul polycounter lvl 18
    Oh yeah, you'll want to use the longest lens possible as well to reduce the size of the singularity at the back of the map.
  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    if its for interior environments why do you need to do the mapping on a sphere, you will have some issues at the poles.

    why dont you just render out cube maps and do your mapping on a cube, it gives exactly the same end result, and as i described in an earlier post, you just render 6 square camera views

    you can use a program like HDRShop to convert a cubemap to a latlong
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    I've previously tried the method ivars suggested with transfer maps when creating a LDR cubemap for a space environment with starfields and a few planets. Works just fine imo. But I can see the problem with the fancy things you are looking for.
  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    i did a test using 6 cameras, the result is perfect and seamless
    here is a view from ati cubemapgen, i could use this or hdrshop or a combination to get any variation on the map, probe, latlong, cube cross, cube dds, etc.

    EDIT: some minor distortion in the sphere reflection is from the realtime viewport shading in cubemapgen, not actualy errors or such in the rendered images.

    cubemap_6images.jpg
  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    Here is my Maya scene setup to render out the cubemap images, one minor note, in cubemapgen the -z and +z are reversed from what they should be in maya, but the scene is configured to compensate.

    cubemap_maker.ma
  • sama.van
    Offline / Send Message
    sama.van polycounter lvl 14
    It's a real shame because look what I can get with the MRBake :

    MRB.png

    But yes I do not have shader...

    Now I found an attribute on the Bake Set node I didn't know it in the documentation :

    - http://download.autodesk.com/us/maya/2009help/Nodes/bakeSet.html

    On the bottom there is a line about Custom Shader...
    I really do not know how this one work and doing some test.
    It could be a solution to the problem...


    Problem with the method to render 6 textures is I have to attach it together after rendering.
    For sure I can create a JS script in Photoshop and I already done a little JS lib for that thing...

    But really... Maya... We could success without doing that manually. There is probably a solution :D , I will continue to check around.
  • andorahms
  • andorahms
Sign In or Register to comment.