Author Topic: CoronaDisplacementMod to Mesh  (Read 8977 times)

2016-07-18, 16:31:41

deshu

  • Active Users
  • **
  • Posts: 35
    • View Profile
Hello.

I my work, I often use build in 3dsMax Displace modifier to achieve some surface-level details.

The problem is, for displacement to look perfect, I need extreme mesh density.

It would be lovely, to be possible to use Corona Displacement adaptivity algorithm, along with minimum/maximum* edge length setting, to "bake" actual meshes.

Mesh achieved this way could be used as blueprint for modeling in CAD softwares, or, for example, 3d printing.

*Currently we can set maximum edge length when using world units in prerender disp calculations.

2016-07-18, 16:57:24
Reply #1

PROH

  • Active Users
  • **
  • Posts: 1045
    • View Profile
+ 1 for making it possible to collapse the Corona Displacement modifier into a mesh - just like 3dsMax displacement modifier.

2016-07-18, 17:22:10
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 9269
  • Marcin
    • View Profile
I think that with the "screen size" option you would end up with nice pretty displacement where camera can see it, and with fugly mess where camera cannot see it, or if it would be a big object - where it is further from the camera. With the "world size" option you would probably get more or less the same thing as when using 3dsmax displacement. I might be wrong though.

2016-07-18, 17:42:33
Reply #3

deshu

  • Active Users
  • **
  • Posts: 35
    • View Profile
+ 1 for making it possible to collapse the Corona Displacement modifier into a mesh - just like 3dsMax displacement modifier.

I wouldn't say "colapse", since CoronaDisplacement isn't visible in viewport. CoronaDisplacementMod could just have "Create Mesh Object" button.

I think that with the "screen size" option you would end up with nice pretty displacement where camera can see it, and with fugly mess where camera cannot see it, or if it would be a big object - where it is further from the camera. With the "world size" option you would probably get more or less the same thing as when using 3dsmax displacement. I might be wrong though.

Since screensize displacement operates on pixels, for this option to work, you would have to specify resolution and camera in CoronaDispMod itself. I don't find user-friendly.

However, world size corona displacement operates on scene units, and doesn't care about POV. Additionaly, it's adaptive, which makes it really good solution.

2016-07-18, 17:55:09
Reply #4

Ricky Johnson

  • Active Users
  • **
  • Posts: 104
    • View Profile
I would really like to see something introduced like this as well. Just to have the potential to create whatever the adaptive Corona displacement would calculate as a mesh - or at least an option within the current CoronaDisplacementMod to cache a calculated mesh in RAM.

I spend a lot of time, when doing test renders, waiting for the same displacement to be calculated again and again*.
The 3ds Max Displacement modifier is an alternative option in these situations but it lacks the adaptivity that is a big bonus for the Corona version.
I would accept that a 'baked in' calculation using Screen Size would not work very well if you're changing viewpoints but quite often you're at a stage when you have a fixed viewpoint so think this would still be very useful. I actually be pretty interested in seeing what the adaptive displacement had done with the mesh if you could look at this in the viewport after a render.
Resolution and Camera could be drawn directly from the main render settings at the time couldn't they?

* I think I raised something like this before in an earlier thread and it was argued that being able to use Interactive Render made this request somewhat redundant.
I can accept that to some degree but I'm still of the opinion that this would be extremely useful if you prefer to use the normal render to perform tests.

2016-07-18, 18:12:07
Reply #5

Paul Jones

  • Active Users
  • **
  • Posts: 169
    • View Profile
Quad Mesh would be better still

2016-07-18, 18:24:52
Reply #6

PROH

  • Active Users
  • **
  • Posts: 1045
    • View Profile
@deshu: yes I agree "collapse" isn't the right word, and "create mesh object" is better.

Regarding screen vs world size units, then of course it should be "world". And NO, I don't think it'll be the same as when using 3dsMax's displacement mod - Corona Disp. mod is adaptive and gives much nicer result than Max mod. But when using "screen" globally, there should be a "global override" option in the Corona mod, so it could work on "world" - and the other way around.

2016-07-18, 19:06:00
Reply #7

deshu

  • Active Users
  • **
  • Posts: 35
    • View Profile
I would really like to see something introduced like this as well. Just to have the potential to create whatever the adaptive Corona displacement would calculate as a mesh - or at least an option within the current CoronaDisplacementMod to cache a calculated mesh in RAM.

Caching disp would be awesome. Even without automatic changes detection (when user changes map between renders, or changes displacement values).

Resolution and Camera could be drawn directly from the main render settings at the time couldn't they?

Ofcourse, those information (currently active viewport/camera and render resolution) are available application-wise, even via maxscript.

2016-07-18, 23:28:12
Reply #8

cecofuli

  • Active Users
  • **
  • Posts: 1492
    • View Profile
In this model, adaptive Corona displacement doesn't make sense.
Displacement adaptivity is on by default and it's useful when you have big, flat surface with some detailed surface.
For example, a brick wall.
When you have a complete curve surface, all the mesh will be subdivided in the same level.

Screen: subdivision of the displacement depends on the image resolution and the distance from the camera.
It's a little bit complicated to calculate the exact "size". But it's useful to save ram, because Corona doesn't subdivide the portion of mesh that you don't see.
Also, more far is the mesh, less subdivision will be.

World: It's independent from distance and resolution . Easier to setup (cm, mm etc...), but it subdivide the entire mesh.
For example, if you have a long road and you are in the middle of this road, Corona will subdivide also the mesh behind you.
Useful for interactive render, but it eats a lot of ram and you have to wait a lot at the beginning of the rendering.



2016-07-19, 10:39:10
Reply #9

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8904
  • Turning coffee to features since 2009
    • View Profile
1) apply displacement to an object
2) Go to system -> export scene
3) object gets saved in corona proxy format on HDD
4) create an empty corona proxy object
5) load the object back in the corona proxy, it will have the displacement baked in
6) ???
7) PROFIT!
Rendering is magic.
Private scene uploader | How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-07-19, 11:00:53
Reply #10

cecofuli

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

2016-07-19, 11:40:18
Reply #11

PROH

  • Active Users
  • **
  • Posts: 1045
    • View Profile
@ Ondra: Just tried this in a scene where system units was set to meter. The loaded geometry (in the proxy) came in a 1000 times to small (millimeter?). Is this intended behavior or a bug? Or am I doing something wrong?

2016-07-19, 11:50:58
Reply #12

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8904
  • Turning coffee to features since 2009
    • View Profile
it might be bug, can you report it?
Rendering is magic.
Private scene uploader | How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-07-19, 12:48:01
Reply #13

PROH

  • Active Users
  • **
  • Posts: 1045
    • View Profile
Reported on Mantis: ID 0002016

2016-07-19, 13:03:29
Reply #14

Ricky Johnson

  • Active Users
  • **
  • Posts: 104
    • View Profile
Thanks for that tip. It's very useful!

I am getting the same effect as PROH upon import of the proxy. My object was 10 times too small (Scene & Display Units were in cm). Not a huge problem to remedy temporarily as it's an exact amount.

2016-07-19, 14:36:32
Reply #15

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 9269
  • Marcin
    • View Profile
Holy crap, it works! You can then optimize the mesh, or do some other evil things to it. You can also apply displacement to displacement!
I am also getting the 10x smaller issue.

2016-07-19, 15:08:38
Reply #16

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6076
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Corona's displacement when set to world size, is no better than max displacement modifier and when set to screen it's useless in baked form. So what's the fuss about?
I'm not Corona Team member. Everything i say, is my personal opinion only.

2016-07-19, 15:42:50
Reply #17

Ricky Johnson

  • Active Users
  • **
  • Posts: 104
    • View Profile
Corona's displacement when set to world size, is no better than max displacement modifier and when set to screen it's useless in baked form. So what's the fuss about?

In screen mode it's not useless to me if you are working to a predetermined camera/resolution. Consider for instance a heavy-poly object which is only partially visible.
You could go manually splitting the object at the edges of the camera but I'd rather use this method. It's only a tip after all, so nothing gets changed.

Also, considering possible benefits in world mode, doesn't Corona's displacement calculate adaptivity based on the detail in the displacement map as well?
I honestly don't know if it works in this way or not (have to go back and look at some of the threads from when adaptive displacement was introduced) but theoretically this would make it more efficient than Max's modifier.


2016-07-19, 15:48:48
Reply #18

PROH

  • Active Users
  • **
  • Posts: 1045
    • View Profile
I too was under the impression that Corona calculated adaptivly, but I don't know any of the theory behind it. I do know however, that I never had Max's displacement or disp. mod working as good as Cornas.

2016-07-19, 16:18:04
Reply #19

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6076
  • Let's move this topic, shall we?
    • View Profile
    • My Models
In screen mode it's not useless to me if you are working to a predetermined camera/resolution. Consider for instance a heavy-poly object which is only partially visible.
You could go manually splitting the object at the edges of the camera but I'd rather use this method. It's only a tip after all, so nothing gets changed.

Fair enough, if it works for you then everything is fine :]

I too was under the impression that Corona calculated adaptivly, but I don't know any of the theory behind it. I do know however, that I never had Max's displacement or disp. mod working as good as Cornas.

Nope, just tested that this morning and Corona's displacement in world mode gives very similar results as if mesh would be manually subdivided with displacement modifier on top. But with baked version you'd loose all the benefits of max's modifier stack.
I'm not Corona Team member. Everything i say, is my personal opinion only.

2016-07-19, 16:34:22
Reply #20

deshu

  • Active Users
  • **
  • Posts: 35
    • View Profile
Firstly:

Ondra - Thanks for the tip!



Secondly:

In this model, adaptive Corona displacement doesn't make sense.
Displacement adaptivity is on by default and it's useful when you have big, flat surface with some detailed surface.
For example, a brick wall.
When you have a complete curve surface, all the mesh will be subdivided in the same level.

Corona's displacement when set to world size, is no better than max displacement modifier and when set to screen it's useless in baked form. So what's the fuss about?

This night I've made some quick tests and I have to admit, that your pessimism on my request is justified.

Corona displacements adaptivity works different way than i used to thing while making this topic.

Later this week I'll make a post with some tests, analyse, and my thoughts in that matter.

2016-07-19, 16:38:46
Reply #21

PROH

  • Active Users
  • **
  • Posts: 1045
    • View Profile
OK. I work a lot with large low poly geometry coming from CAD or BIM programs, so I might not have subdivided it enough for the Max Disp. Mod to work well enough (much easier just using Coronas Disp. mod).

Regarding the lack of benefits when "baking" displacement, then you can't export displaced mesh without "baking" it - and that is one of my main reasons to do it.

Will dive deeper into standard Max Disp. mod :)

2016-07-19, 16:52:05
Reply #22

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6076
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Will dive deeper into standard Max Disp. mod :)

You won't regret it, in certain situations displace modifier can be vastly more effective than rendertime displacement.
I'm not Corona Team member. Everything i say, is my personal opinion only.

2016-07-21, 10:07:00
Reply #23

alberto_royo

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

2) Go to system -> export scene
3) object gets saved in corona proxy format on HDD

sorry, but I don't undertand this point. I export scene but only format alowed is *.scn, not proxy, and then I can't load the proxy object

2016-07-21, 13:32:36
Reply #24

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 9269
  • Marcin
    • View Profile
Export as .scn. This is what you should see in the specified folder:


Then create a proxy object and load one from the "geometry" folder.

2016-07-22, 10:00:01
Reply #25

alberto_royo

  • Active Users
  • **
  • Posts: 38
    • View Profile
Well, I feel a bit stupid, I was right there ... Thank you !!

2016-08-22, 19:47:27
Reply #26

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8904
  • Turning coffee to features since 2009
    • View Profile
we will fix the bug, but we will not add a separate option to do this, the displacement is meant to be render time-only, not for modelling
Rendering is magic.
Private scene uploader | How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)