Weird Render To Texture Result

Weird Render To Texture Result

Anonymous
Not applicable
7,580 Views
17 Replies
Message 1 of 18

Weird Render To Texture Result

Anonymous
Not applicable

Hi, I'm baking AO into my textures and about 20% of my models are yielding a really strange result: the baked AO is totally mis-aligned.  It's almost like Max is rendering using a different Map Channel or something.  Or the model is reading the UVW map incorrectly.  Sorry, I don't have enough experience with UVW's and Map Channels to be able to clearly articulate what's going on.

They are simple Editable Meshes.  I add an Unwrap UVW, Quick peel and flatten them, then render to texture.  Not sure why some work fine and other don't.

I've tried rendering them in batches and rendering them individually.

I've tried removing UVW's and Material and redoing the process.

I've tried resetting Max and merging the problematic models in.

 

Any pointers would be much appreciated.

0 Likes
7,581 Views
17 Replies
Replies (17)
Message 2 of 18

miledrizk
Advisor
Advisor

Hi,

 

1- In the Render To Texture dialog make sure to check the option "Use Existing Channel"

 

unwrap.PNG

 

2- But before the Render To texture process,

    I personally prefer, instead of using Quick Peel, you select all the polygons, and in the Edit UVWs, go to Mapping

    Menu, Flatten Mapping, keep the defaults and press OK.

 

flatten.PNG

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
0 Likes
Message 3 of 18

Anonymous
Not applicable

Sorry for the delay in responding.  Got pulled into another project and didn't have time to troubleshoot this.

I tried your technique and it yielded the same results.

I also tried a bunch of combinations below:

Reset XForm and then collapse stack to Editable Mesh > No change

Center axis and align to work > No change

Delete Unwrap UVW modifier and verify I'm doing the exact same steps on each model > No change

Isolate the model > very much improved, almost completely, but there are definitely still some quirks.

 

It's almost like 3ds Max thinks the model is in a different location that it actually is.  It seems like 3ds Max is rendering shadow from objects that are actually not there.

 

I'm kind of at a loss what I should try next.  Any help would be appreciate.

 

0 Likes
Message 4 of 18

miledrizk
Advisor
Advisor

Is it possible that your geometry is too far from the origin?

3DS Max hates objects too far from 0,0,0 and it can get very inaccurate in some cases.

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
Message 5 of 18

Anonymous
Not applicable

That's a good suggestion.  I definitely ran into some float point errors when I had this scene in Unity.

But in the previous images, the buildings where the UVW is fine are actually further away from the origin than the ones where the UVW is goofy.  But just in case, I checked it out.  Unfortunately, I re-centered it to world origin and the results were the same.

Here are some of the things I've tried:

  • Remove all the materials and UVWs.  Reapply Unwrap UVW. > No change.
  • Remove materials and UVWs.   Reset scene.  Merge in models.  > No Change.
  • Export obj with no materials or texture coordinates.  Re-import obj.  > No change.
  • Reset scene.  Import obj.  > No change.

 

Let's take one model for example:  I removed UVWs and materials.  Converted to Edit Poly.  Converted back to Edit Mesh.  Removed UVWs and materials (again just in case).  Exported an obj with no materials.  Reset Max.  Imported the obj.  Applied Unwrap UVW.  Only did flatten.  Rendered to texture and this is what comes up:RenderTextureError01.png

0 Likes
Message 6 of 18

miledrizk
Advisor
Advisor

Let's do one more test,

After the flattening process, and before the Render to texture,

In the Edit UVWs window, try to select one of the UVs that has a problem and move it a little.

I just want to check if there are overlapping UVs.

I'm just suspecting that some faces are receiving the wrong portion of the baked texture.

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
0 Likes
Message 7 of 18

Anonymous
Not applicable

I seems okay.  I guess I'm not 100% sure what I'm supposed to be looking for.  In the image below, I've selected a face that I know is one that is messed up when I render to texture.  I select it and you can see it in the UV Editor.  When I move it around or scale it, it behaves as I would expect.

UV Editor.png

 Then I render to texture...

Render0.pngRender1.pngRender2.pngRender3.png

 

 

 

 

 

0 Likes
Message 8 of 18

miledrizk
Advisor
Advisor

I think you have a problem with your geometry itself,

From your screenshots I'm guessing you have overlapping faces,

And this is shown in what it looks like overlapping UVs(2 UVs at the same place)

 

Overlapping UVsOverlapping UVs

Overlapping PolygonsOverlapping Polygons

I need you to go to the Polygon Sub-Object level on the object shown in the image above,

Click to select the polygon and press delete. I'm guessing you'll find another Polygon in the same place.

If this is the case then you'll have to do some cleaning to your geometry before Rendering to Texture.

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
0 Likes
Message 9 of 18

Anonymous
Not applicable

Thanks for sticking with me.

So it deleted the faces and there didn't appear to be anything behind.

I also created a new face there and the render to texture had the same result. 

01.png02.png03.png04.png05.png06.png07.png08.png09.png10.png11.png

 

 

 

 

0 Likes
Message 10 of 18

Anonymous
Not applicable

Hmmm... so I tried moving the model to a different part in the scene.  I didn't alter the Unwrap UVW modifier at all.  Just rendered to texture, moved it, and rendered again.  The texture came out fine in the new position.  It's something to do with the location... or another model new that location?

14.png15.png

0 Likes
Message 11 of 18

miledrizk
Advisor
Advisor

Well, good,

I was thinking of doing a short video about render to texture using scanline renderer,

And a Skylight with shadows ON, since I don't know which rendering engine you're using, and what light, etc,...

I thought with Scanline is better.

But if it's working now than it's good news.

 

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
0 Likes
Message 12 of 18

Anonymous
Not applicable

Okay, I think I'm zeroing in on the culprit but I'm not quite there...

 

As I said in my previous post, if I move the models far away in the scene, they render fine.

Next I tried moving the models just a little bit and saw that the weird shadow stayed in the same location:

 

17.png18.png19.png

 

So I reset Max and merged in only the single model.  First thing I notice is when I create a new Standard material, it started at Material #46.  The next one was Material #67.  Usually it goes Material #25, Material #26, etc.  So it appears that there are some embedded/buried materials in the model.  A lot of them.  Anyone know how to confirm that?

 

Next, I did a few render to textures while moving the model around and, yep, there's some object in there creating shadows when it renders to texture:

23ps.png24ps.png25ps.png

 

I rendered the texture of the plane and:

26ps.png27ps.png

 

I only have two objects in my scene: the model of the buildings and the plane.  But just to confirm that the ghost object is actually in the model of the buildings, I rendered one with just the plane:

28ps.png

 

 

So there you have it.  It appears that some of my models have ghost geometry that is casting shadows when I render to texture.  This ghost geometry stays in the same world space no matter where the actual geometry is (hence why is cast the shadow in the same spot no matter what geometry is there).  And this ghost geometry sticks around within the model even if you export as obj, or reset XForm, or remove UVWs, or remove materials.

 

Not sure how it happened.  I was optimizing this scene for a game engine so I was attaching and detaching a lot.  Grouping geometry together.  Converting to Editable Poly and then Editable Mesh.  Stuff like that.  I bet I collapsed a stack somewhere or deleted only an element of an Editable Poly or something like that and the information got embedded in the model.

 

At least, that what it seems like to my tired brain, lol.  I've been troubleshooting this for about 12 hours now so I'm a bit burned out, lol.  Gonna call it a night.

 

Any suggestions would be very much appreciated.

 

Cheers.

0 Likes
Message 13 of 18

miledrizk
Advisor
Advisor

Check in the Polygon or Element sub-object level to see if you have hidden polygons

 

Unhide PolygonsUnhide Polygons

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
0 Likes
Message 14 of 18

Anonymous
Not applicable

Thanks for the suggestion.  I did as you suggested and it did not have an effect.

Worse... I noted the location of the ghost geometry (X=540, Y=40);  closed 3ds Max;  opened a new scene;  created a plane and a box;   placed the box at the location where I saw the ghost image (X=540, Y=40) and it was still there...

02.png

 

So this is happening in brand new environments... Am I crazy to be thinking about uninstalling 3ds Max and reinstalling?

0 Likes
Message 15 of 18

miledrizk
Advisor
Advisor

I can suggest resetting your User Settings:

1- Close 3DS Max

2- go to: C:\Users\YourUserName\AppData\Local\Autodesk\3dsMax\20xx - xxbit

3- Rename the folder called ENU to something else like ENU.old

4- Restart 3DS Max

 

Note: AppData is a hidden folder, so you need to enable the visibility of hidden files and folders

From the Control Panel

 

Also, by doing this, you'll lose any custom UI configuration

Or any custom 3rd party Macroscripts you installed, and you'll have to reinstall them again.

If renaming the ENU doesn't help, then close Max, delete the newly created ENU folder,

And then rename the old one ENU again, this way when you restart 3DS Max you'll have back

All your custom UI settings and 3rd party Macsroscripts.

------------------------------------------------------
miledrizk@gmail.com
3DS Max 2025, V-Ray 7
3DS Max user since 2003 (3DS Max 7)
V-Ray user since 2008 (V-Ray 1.47)
0 Likes
Message 16 of 18

Anonymous
Not applicable

Ah, yes, the ol' ENU trick.  Good suggestion.

And... crap.

03.png

 

This is just weird now.  I'm going to uninstall 3ds Max and reinstall.

I'll report back after that.

 

0 Likes
Message 17 of 18

Anonymous
Not applicable

Okay.  So I uninstalled 3ds Max and reinstalled.  Still got the same results on new scenes.  Autodesk never fully uninstalls and leaves a crap ton of folders on your computer so to make sure, I installed 3ds Max on a computer that had never had Autodesk products on it and still got the same results.

 

See if you can recreate the result.  Create a Plane001.  Size 10,000 x 10,000.  Create Box001.  Size 1,000 x 1,000.  Position: 540,40,0.  I added a couple other boxes to the scene below:

01 Center Circle.png

 

I inserted a sphere and it appears that a sphere with R=150 fits the white space.

02 Center Circle.png03 Center Circle 150.png

 

I rendered one without a plane and saw that there was no anomaly:

08 Two Squares.png

 

So the anomaly only shows up when the plane is there.

I rendered one with 20x20 segments and another with 1x1 segments.  Same result.

04 plane 10000x10000 ps.png

 

So I started reducing the size of the plane and saw that the size of the anomaly got smaller as well.

05 plane 7000x7000 ps.png06 plane 6000x6000 ps.png07 Two Squares and plane 500x500 ps.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Okay, so here's where I'm at:

  • The anomaly only shows up when a plane is present
  • The anomaly grows and shrinks with the size of the plane
  • When the plane is about 6,500 x 6,5000, the anomaly is gone.

 

Maybe it's a unit scale issue?  My unit scale is in inches so these objects are in the thousands of inches.  That's pretty big.  But if it is a unit scale issue, you'd expect to see the same issue whether the plane is there or not, correct?  Why is the anomaly only there when the plane is present but everything looks great when the plane is less than 6,500 x 6,500 or is not in the scene?

This kind of makes me think it's not a unit scale issue.  I really hope it's not.  I have a bunch of animations and riggings so I'd have to basically rebuild my entire project if I have to change my unit scale to feet.

 

0 Likes
Message 18 of 18

jorisceoen
Participant
Participant

"Is it possible that your geometry is too far from the origin? 3DS Max hates objects too far from 0,0,0 and it can get very inaccurate in some cases."

 

This answer literally saved me a strong headache over weird Render-to-Texture problems that I've been having yesterday and today. I have a very large scene with tons of objects, and sometimes design props within the scene itself (to easily visualise). However, when I then hit the render button, random empty transparant spots appear in the final result. Putting the object at 0, 0, 0 fixes this issue completely.

 

Thanks for this incredible solution miledrizk, I never knew this could possibly be an issue!