Author Topic: Render to Texture issue (Normal Map Raytacing issue?)  (Read 14447 times)

2017-08-10, 20:23:35
Reply #15

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8857
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Sorry, i still don't get it. Could you resave that scene in your previous post to max 2016 and reupload it? Maybe then i can figure out what's going on.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-08-10, 22:08:24
Reply #16

Cobra8472

  • Active Users
  • **
  • Posts: 14
    • View Profile
http://media.heatblur.se/RTT_Issue_2016.rar

The procedure is simple: Render the scene from any angle and note that the object appears just fine (like in Sketchfab).

Run the render to texture which is setup, save the texture, and apply it to the model.  Note all the seams appearing due to incorrectly shaded lighting and reflections.

To the corona team: this may be something with how normals, binormals or tangents are calculated in RTT mode.
« Last Edit: 2017-08-11, 01:26:29 by Cobra8472 »

2017-08-10, 23:31:33
Reply #17

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8857
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Server not found...
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-08-11, 01:26:36
Reply #18

Cobra8472

  • Active Users
  • **
  • Posts: 14
    • View Profile

2017-08-11, 11:07:22
Reply #19

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8857
  • Let's move this topic, shall we?
    • View Profile
    • My Models
"The file was saved in max2017"

Thanks for wasting my time...
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-08-11, 13:51:57
Reply #20

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5468
    • View Profile
I downloaded the file, saved it as Max 2016 from 2017, here it is attached -
Tom Grimes | chaos-corona.com
Product Manager | contact us

2017-08-11, 15:14:34
Reply #21

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8857
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Thanks Tom, did you save it with 1.7? - it crashes max on trying to open with 1.6, but opens fine with daily build installed. Anyway, there was no normal map texture with file, so i couldn't test what's wrong with RTT, but the model itself has big problems - first of all it has smoothing groups scattered all over the place and that's more than likely will cause problems with normal maps. What's more starnge, is that Corona RTT throws error message that model contains no triangles and it will not render. I tried all the tricks that i know to fix that, but the only one that helped was exporting model as OBJ and reimporting it back.

My conclusion at the moment is this: Corona RTT works fine, problem is in the model.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-08-11, 15:20:23
Reply #22

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5468
    • View Profile
Oops sorry my bad, yes I had the latest daily installed :(
Tom Grimes | chaos-corona.com
Product Manager | contact us

2017-08-12, 21:59:35
Reply #23

Cobra8472

  • Active Users
  • **
  • Posts: 14
    • View Profile
    Thanks Tom, did you save it with 1.7? - it crashes max on trying to open with 1.6, but opens fine with daily build installed. Anyway, there was no normal map texture with file, so i couldn't test what's wrong with RTT, but the model itself has big problems - first of all it has smoothing groups scattered all over the place and that's more than likely will cause problems with normal maps. What's more starnge, is that Corona RTT throws error message that model contains no triangles and it will not render. I tried all the tricks that i know to fix that, but the only one that helped was exporting model as OBJ and reimporting it back.

    My conclusion at the moment is this: Corona RTT works fine, problem is in the model.


    This is getting redicilous. This bug is super obvious and we're now two pages in and you are still telling me that my model / normal is wrong. I appreciate the effort to help, but you need to stop telling me that I am so incompetent that I cannot create a properly baked normal mapped object.

    It's disappointing that Corona staff is not commenting. The issue is readily apparent within 5 minutes of: baking a model with a normal map, and doing a RTT (Beauty map). Seams all over the place on the rendered texture.

    With regards to your specific concerns:

    1) The smoothing groups are scattered because that is what you do for a normal baked model: you split the model by UV Seams. This is industry standard!!
    This causes NO problems in any realtime engine: Unreal Engine 4, Unity, 3ds max with normal mapping shader. Not a single engine has any issues (you just commented on the sketchfab above, which has the exact same smoothing groups)

    2) The model containing "no triangles" is because Max RTT tends to default to MatID/UV Set 3 for RTT. Set it to 1 (where the UV is) and it works without issue.

    3) The Normal map is included in the previous .rar, where the file was in Max 2017 format. It's in DX Tangentspace (IIRC) - but try flipping green just to make sure (I can't recall off the top of my head)[/list]
    « Last Edit: 2017-08-12, 23:04:02 by Cobra8472 »

    2017-08-12, 23:01:39
    Reply #24

    Cobra8472

    • Active Users
    • **
    • Posts: 14
      • View Profile
    I've made a completely new example now so we can move away from the model blaming. As simple as you can get: a box.
    A Low-Poly box with a HP baked normal. Smoothing groups split along UV seams. Standard.

    Here is what it looks like in Marmoset without the Normal applied: http://i.imgur.com/bqBul21.png

    Here is what it looks like in Marmoset with the Baked Normal: http://i.imgur.com/F3FJlzf.png
    Good.

    Here is what it looks like in Corona with a Camera render with the Baked Normal: http://i.imgur.com/xLJpq6o.png
    Good.


    All is good so far


    And now lets run a Render to Texture (Corona Beauty) with appropriate padding.
    Apply the rendered texture to the model and switch to Flat viewport mode to remove all lighting:

    Here is how it looks: http://i.imgur.com/89FIK7l.png
    Bad!

    There are now seams at UV borders!! The rendered texture has seams.
    Everything is identical, but the RTT texture has seams.



    Here are all of the files if you want to try by yourself.
    The .max file is for sure in Max 2015 format: http://media.heatblur.se/CORONA_ISSUE.rar



    « Last Edit: 2017-08-12, 23:07:17 by Cobra8472 »

    2017-08-12, 23:45:53
    Reply #25

    romullus

    • Global Moderator
    • Active Users
    • ****
    • Posts: 8857
    • Let's move this topic, shall we?
      • View Profile
      • My Models
    Sorry, didn't realised that you have splitted smoothing groups along uv shell borders. Smoothing is messy, but if it bakes well, then that's no problem. I will take a look at your box example tomorrow.
    I'm not Corona Team member. Everything i say, is my personal opinion only.
    My Models | My Videos | My Pictures

    2017-08-13, 00:01:04
    Reply #26

    romullus

    • Global Moderator
    • Active Users
    • ****
    • Posts: 8857
    • Let's move this topic, shall we?
      • View Profile
      • My Models
    Ok, i reproduced and can confirm the bug. Moving this topic to bug reporting board. Thank you for scene.
    I'm not Corona Team member. Everything i say, is my personal opinion only.
    My Models | My Videos | My Pictures

    2017-08-13, 00:27:48
    Reply #27

    Cobra8472

    • Active Users
    • **
    • Posts: 14
      • View Profile
    Thanks for the help romullus! Apologies for the frustrated tone. Stressed! :)

    2017-08-13, 10:53:39
    Reply #28

    romullus

    • Global Moderator
    • Active Users
    • ****
    • Posts: 8857
    • Let's move this topic, shall we?
      • View Profile
      • My Models
    No worries, with the proper scene it was a matter of seconds to replicate and confim the bug.
    I'm not Corona Team member. Everything i say, is my personal opinion only.
    My Models | My Videos | My Pictures

    2017-10-21, 14:20:04
    Reply #29

    Cobra8472

    • Active Users
    • **
    • Posts: 14
      • View Profile
    Corona team; any ideas/progress on this issue?