Using Daz Studio to create sprites, is there a way to create 2d normal map?

3DMinh3DMinh Posts: 258
edited January 3 in The Commons

Hi,

I'm using Daz Studio and assets on the store to create 2d sprites for a project, to be used in Unity engine. Now, for each 2d sprites there can be a normal map that helps with 2d lighting.
My question is, because the 2d sprites I'm creating is rendered out of a 3d models in Daz, how can I also render out the normal map in 2d? Is it possible?

Originally I was to buy this software: https://www.codeandweb.com/spriteilluminator. But if I understand correctly because models in Daz is already 3D, it will be more accurate to try to use that information instead of using other software and trying to recreate it?

Thank you very much.

Post edited by 3DMinh on

Comments

  • 3DMinh3DMinh Posts: 258

    For reference, I want to achieve the same thing one user posted here: https://www.daz3d.com/forums/discussion/47049/can-you-render-normal-maps/

    But this was 10 years ago, so I want to know what's the best solution now. What I want to achieve is what he said here:
    "I want to press render in Daz3D to create an image. This image will be your average render.
    Then I want to press render again, and get an image that is a normal map for the first image."

    I don't mind to set this up intitially, even if it's complex or requires other programs. But I really want to have a "universal" toolkit, for example some special camera that will do this all the time, for any scene, any object without having to adjust and fix every time.

    Thank you.

  • lilweeplilweep Posts: 2,544
    edited January 3

    I have no idea, but you can easily make a black and white depth map using Canvases. 

    Possibly you can convert the depth map to a normal map for the scene.  I googled depth to normal converter and some results came up https://github.com/cobanov/depth2normal

    Post edited by lilweep on
  • Richard HaseltineRichard Haseltine Posts: 101,965

    With iray active, in the Advanced tab of Render Settings go to the Canvasses sub-tab, enable them, and click the + to add a Normal pass; I would also add a Diffuse pass for the whole scene as otherwise the lighting will fight the normals to an extent (you could add an Ambient Occlusion too, then combine that with the diffuse to get shadows in recessed areas without baked in lighting). The result will be a set of .exr files in the a rendername_canvases sub-folder.

  • 3DMinh3DMinh Posts: 258

    Richard Haseltine said:

    With iray active, in the Advanced tab of Render Settings go to the Canvasses sub-tab, enable them, and click the + to add a Normal pass; I would also add a Diffuse pass for the whole scene as otherwise the lighting will fight the normals to an extent (you could add an Ambient Occlusion too, then combine that with the diffuse to get shadows in recessed areas without baked in lighting). The result will be a set of .exr files in the a rendername_canvases sub-folder.

    OMG. Thank you very much, this is much more simpler than I thought! 

    Can I ask couples of things:
    + I understand about the diffuse pass to "fight" the effect of lighting (since I'll be making 2d sprites and the game engine I use would handle the lighting there), but do you know what's the best practice in lighting these scenes that I'll use as 2D sprites? Not just the normal map rendering, but also the full render with textures. Should I just add one light that point directly at the object from the camera? Or I can just light the scene in whatever way that looks good, and then use the combination of Diffuse pass and Ambient Occlusion for the normal map rendering? Or should I remove the lighting all together in the normal map rendering process?

    + I see the result is an .png file that look like the normal map to me, why should I need the .exr files? What are they for?

    For as long as I joined daz forum, you have almost always provided the most useful answers to me as well as others. Thank you very much, and happy new year !

  • 3DMinh3DMinh Posts: 258

    lilweep said:

    I have no idea, but you can easily make a black and white depth map using Canvases. 

    Possibly you can convert the depth map to a normal map for the scene.  I googled depth to normal converter and some results came up https://github.com/cobanov/depth2normal

    Thank you for your reply. Actually the Canvases has the normal pass, so that's great :D.

  • inge.raschinge.rasch Posts: 21

    In terms of lighting, it shouldn't matter, because the normal map should express the vector (the "angle") of the 3d model's surface at a given point. That should be x,y,z of the normal vector expressed as the R, G and B channels of an image. The background color I mentioned in my post (10 years ago, yikes) represents a flat surface.

    If you have light info from the scene in the normal map, you are doing something wrong. For the sprite itself, it should also have no lighting. Use a shader that renders only the color value of the texture. You want Unity to do the lighting of the object.

    I haven't used DAZ much these last years, but I'm sure someone here can help with that as well.

  • crosswindcrosswind Posts: 7,653

    Alternatively, you may also use https://boundingboxsoftware.com/materialize/ to make NM maps. It's free / more customizable / fast ...

  • 3DMinh3DMinh Posts: 258
    edited January 3

    inge.rasch said:

    In terms of lighting, it shouldn't matter, because the normal map should express the vector (the "angle") of the 3d model's surface at a given point. That should be x,y,z of the normal vector expressed as the R, G and B channels of an image. The background color I mentioned in my post (10 years ago, yikes) represents a flat surface.

    If you have light info from the scene in the normal map, you are doing something wrong. For the sprite itself, it should also have no lighting. Use a shader that renders only the color value of the texture. You want Unity to do the lighting of the object.

    I haven't used DAZ much these last years, but I'm sure someone here can help with that as well.

    Thank you. I understand what you mentioned, and I also want the normal map to not be affected by lighting, and also the sprites. That's why I'm hoping Richard Haseltine can help me with the questions above, because in Iray I think there should always be a light to render ?

    Post edited by 3DMinh on
  • 3DMinh3DMinh Posts: 258

    crosswind said:

    Alternatively, you may also use https://boundingboxsoftware.com/materialize/ to make NM maps. It's free / more customizable / fast ...

    I think you misunderstood what I'm asking, I want to create normal map of a 2d image to make it contain the "3d information" of a 3d model, not the normal map that is used on the surface of 3d model to make it more details. But I could be wrong.

  • crosswindcrosswind Posts: 7,653
    edited January 4

    3DMinh said:

    crosswind said:

    Alternatively, you may also use https://boundingboxsoftware.com/materialize/ to make NM maps. It's free / more customizable / fast ...

    I think you misunderstood what I'm asking, I want to create normal map of a 2d image to make it contain the "3d information" of a 3d model, not the normal map that is used on the surface of 3d model to make it more details. But I could be wrong.

    I'm afraid I didn't... with different tools / workflows, the render result of NM map will just be different, depending on the case you have. But I don't know which one can play well in Unity with your 3D > 2D sprites ~~  as I'm no Unity user.

    Edit: that SpriteIlluminator seems interesting...

    SNAG-2025-1-4-017.png
    1981 x 1143 - 955K
    Post edited by crosswind on
  • 3DMinh3DMinh Posts: 258
    edited January 4

    crosswind said:

    3DMinh said:

    crosswind said:

    Alternatively, you may also use https://boundingboxsoftware.com/materialize/ to make NM maps. It's free / more customizable / fast ...

    I think you misunderstood what I'm asking, I want to create normal map of a 2d image to make it contain the "3d information" of a 3d model, not the normal map that is used on the surface of 3d model to make it more details. But I could be wrong.

    I'm afraid I didn't... with different tools / workflows, the render result of NM map will just be different, depending on the case you have. But I don't know which one can play well in Unity with your 3D > 2D sprites ~~  as I'm no Unity user.

    Edit: that SpriteIlluminator seems interesting...

    Hi, sorry my bad I'm the one who misunderstood :D. Thank you for the tool you've sent, I'll definitely check it out.
    Best regards,

    Minh

    Post edited by 3DMinh on
  • algovincianalgovincian Posts: 2,626

    Though I haven't been doing so lately, I've rendered independent normal, ao, fresnel, z-depth, etc. maps in DS using 3DL for 10+ years. I wrote custom shaders (shader mixer) and application scripts to do so. This allowed information from the materials on objects in the scene to be included in the generated normal map (opacity maps, displacement maps, etc.), as opposed to simply being based on geometry.

    I've never tried rendering a normal map using an Iray canvas, so I can't comment on that, but I have used Unity in the past. It's been years, but IIRC, tangent space normal maps in OpenGL format did the trick.

    Hope this helps.

    - Greg

Sign In or Register to comment.