Author Topic: Texture baking prototype  (Read 5942 times)

2016-02-29, 17:58:56
Reply #30

raumtaucher

  • Active Users
  • **
  • Posts: 8
  • Call me Ray :-)
    • View Profile
    • My Website
I am also interested in this Topic.
The progressive texture baking from Modo seems to be a really amazing feature.

Examples where to use it:
If you need LOD(Level of Detail) Objects, it is necessary to bake texture and detailes from the HighRes object.
A good example is the tire of a Car.
The profile of a tire is a very complex mesh.
With heightmap for bump/displacement mapping or normal map for normal mapping, you can reduce the amount of triangles used for renderung very much if you do not need to go to close with the camera.

Regards André

2016-04-22, 23:10:37
Reply #31

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
Only experimenting, quick question.

If I enable noise reduction, then I see the effect in the Corona VFB on completing the Render To Texture, but the saved file does not have the noise reduction applied. I can manually save from the VFB and presto, but is it a restriction that the baking can't have the noise reduced version saved automatically (you never know with Max)?

(Scene is just a cube, saving the beauty pass out as the baked element)

Thanks!
   Tom

EDIT - Most recent daily build as of post date, under Max 2017.
« Last Edit: 2016-04-22, 23:16:29 by TomG »

2016-04-23, 00:12:51
Reply #32

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
And another quick question.

If I bake an object that has a displacement map in the material, using the beauty pass, I get unexpected results and wondering if this is correct? Now, I am new to this baking stuff, so it might just be me!

Attaching the crude scene I am using to get a handle on things, and then the result of a bake done when the material uses displacement (almost all dark with just white specks) and then a bake done when the same input is used as a bump instead (works as expected).

Thanks!
   Tom


2016-04-23, 08:33:05
Reply #33

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7294
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Never tried to bake with render-time displacement (not an expert either). Could it work if you adjust cage accordingly to displaced mesh? You can temporarily disable displacement in material, add displace modifier with the same map and height settings on high poly object, adjust cage, turn off displacement modifier, turn on displacement in material and bake again. See if that would help.

Scratch that. It looks like Corona can't bake with projection mapping yet :/
« Last Edit: 2016-04-23, 09:29:13 by romullus »
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-23, 14:08:54
Reply #34

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
TY for the possibility though, was a good thought - and could be the cause of the problems, that the Auto-unwrap isn't mapped to the displaced mesh but to the undisplaced version, so there's all this extra geometry that the unwrap hasn't handled. I have no idea how non-Corona unwrapping goes, never tried it, so not sure if this is just a constraint with baking in general; all new territory to me here (hence the most basic of scenes to keep things as simple as possible!)

Thanks!
   Tom

2016-04-23, 14:26:32
Reply #35

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7294
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Well, i tried to bake with displacement and indeed, Corona gives wrong results here. Not sure if bug or just limitation of render-time displacement, though. Gotta try the same thing with Mental Ray and see how it goes. Will report here if i found something useful.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-26, 19:30:11
Reply #36

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
Hi all!

Still experimenting with baking. I notice that Render from Render to Texture does not create and save the output file using Corona, but does using MentalRay. You can manually save the file from the Corona VFB, but it's an extra step.

Here are the steps I followed

Create box
Apply material (standard, so I can use it in different engines; with checker map so I can see what is baked)
Create two lights, different colours
Save the scene in this form so I can reload as is and test

Corona
Render to texture dialog
Add Corona Beauty element (to go to the self illumination slot, but don't think this affects the result)
Change size to 512 (don't think this affects the result)
Leave the output filename and path at the default (Box001Corona_Beauty.tga)
Hit render in the render to texture
Inspect the material, and the bitmap has not been created and saved; the material node going into self illumination is black, and opening the file locator shows no file with that name has been created

MentalRay
Reload the scene, change to MR engine
Render to texture dialog
Add CompleteMap, to go to the self illumination slot
Change size to 512
Leave the output filename and path at the default (Box001CompleteMap.tga)
Hit render in render to texture
Inspect the material, and the bitmap was created and saved; the material node going into self illumination shows the result, and opening the file locator shows the file exists

Max 2017
Corona Apr 24th daily build

2016-04-26, 19:38:14
Reply #37

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
Have had mixed results here and can't isolate. I found MR had the same problem with the scene. I then created a new one with a sphere and displace and both Corona and MR worked, so I thought maybe it was unwrapping the cube. Tried with a new cube... and both worked this time.

Can't recall if I had applied a UVW_Map modifier to the cube first time round, maybe so and maybe that messed it up. Have sometimes had better results from Corona than MR with displacement too.

I've noticed a couple of other things, so will break those off into their own threads though, in case any of them is a genuine problem and not user error.


2016-04-26, 19:48:52
Reply #38

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
Hi all,

So with my same cube scene, I returned to test displacement. One I run the Render from Render to Texture, the cube becomes distorted when rendering with the original (unbaked) material. If I turn off the resulting "Automatic Flatten UVs" that's been added as a modifier, it returns to normal (or of course if I remove the map going in to the displacement slot). If I paint with a new material copied from the original before doing the render to texture (just in case anything was changed in the materials by the process), the distortion still occurs.

If I follow the same process with MentalRay, the cube does not distort even with the Auto Flatten modifier still enabled.

Thanks!
   Tom

2016-04-26, 19:58:08
Reply #39

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
Hi all!

A quick mod, replacing the cube with a sphere, and then same process to test. Result from the render to texture was used as self illumination in both cases, with no effect from scene lights. The Corona texture shows the seams where the object was unwrapped, but this does not occur with MentalRay. No displacement etc involved here, just a straight Standard material with checker pattern in the diffuse as the source.

Thanks!
   Tom

2016-04-26, 20:56:21
Reply #40

romullus

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

2016-04-26, 21:05:03
Reply #41

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
My blank stare will be all the answer you need :)

In other words, what is padding and where do I find it?

Thanks!
   Tom

2016-04-26, 21:17:59
Reply #42

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7294
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Padding is edge bleeding. It helps to prevent seams to be visible in baked textures. You can find padding control in RTT window's objects to bake rollout. By default it is set to 2, check if it's not set to 0 in your Corona scene. Also try to rise it to 10 or so and see if Corona obeys this settings.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-26, 21:21:34
Reply #43

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7294
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Hi all,

So with my same cube scene, I returned to test displacement. One I run the Render from Render to Texture, the cube becomes distorted when rendering with the original (unbaked) material. If I turn off the resulting "Automatic Flatten UVs" that's been added as a modifier, it returns to normal (or of course if I remove the map going in to the displacement slot). If I paint with a new material copied from the original before doing the render to texture (just in case anything was changed in the materials by the process), the distortion still occurs.

If I follow the same process with MentalRay, the cube does not distort even with the Auto Flatten modifier still enabled.

Thanks!
   Tom

If you use automatic flatten uvs, then your existing uvs are replaced with that. That's why your displacement looks different after baking. It's better to manually set proper uvs and use those for baking. Automatic are for lazy ones or when you in a hurry :]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-26, 21:28:21
Reply #44

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 4037
    • View Profile
Padding is edge bleeding. It helps to prevent seams to be visible in baked textures. You can find padding control in RTT window's objects to bake rollout. By default it is set to 2, check if it's not set to 0 in your Corona scene. Also try to rise it to 10 or so and see if Corona obeys this settings.

Aha this was the very thing - but it was in reverse. Padding was set to 2. Increasing to 10 made the gaps larger, setting it to 0 removed the seams.