Midlevel Adjustment for Displacement

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Midlevel Adjustment for Displacement

Postby treddie » Thu Jan 03, 2013 9:58 am

Hi,

I was curious why Blender has a Midlevel adjustment for displacement in length units? It seems crazy to have any kind of units like meters to determine what midlevel is. Why didn't they simply make it a percentage of gray? In other words, if you don't have an accurate idea of what scale an object is at, it seems illogical to base the midlevel on any distance at all. In fact, just what does it mean to say, for instance, "midlevel distance of 30cm"? 30cm from what?

Very confused :(

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Thu Jan 03, 2013 7:41 pm

just tested v2.65 and it's a slider from 0.0 to 1.0, no meters. What's your version?
I'm sitting, waiting, wishing, building Blender in superstition...

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Thu Jan 03, 2013 9:29 pm

2.64...Time to upgrade!

Curious why they ever had it set up that way, though in 2.64 and earlier...strange.

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Thu Jan 03, 2013 10:23 pm

2.65...Same problem. Is there a config setting somewhere that I can't find that normalizes that slider?

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Thu Jan 03, 2013 10:30 pm

Interesting that the online doc says that it is normalized, but I still get units! I even did a complete uninstall of the previous version before installing 2.65.
Maybe I need to wipe out the user info, too.

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Thu Jan 03, 2013 10:59 pm

go to scene tab and set Units to None!
I'm sitting, waiting, wishing, building Blender in superstition...

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Thu Jan 03, 2013 11:18 pm

aHA! That did it! Thank you very much, CoDemanX.

One question though...When I am importing a mesh, I assume I need to select the correct units. Is the idea that once the mesh is imported, to then turn units to "none"? If so, on exporting, I assume I would then turn units back on, after displacement is finished.

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Fri Jan 04, 2013 12:31 am

doesn't really matter, you can always change scale and if you set it to None before import, it should work just fine.
I'm sitting, waiting, wishing, building Blender in superstition...

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Fri Jan 04, 2013 2:53 am

What units are native to blender? It's important, because if I work say in Meters in all my other programs, then I can avoid nasty scaling issues if Blender is using the same system. Having to worry about scaling can be a pain especially when the conversion can be some unknown factor of 10, or .3937x10^x, or something out of the ordinary.

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Fri Jan 04, 2013 10:08 am

I'm still bugged by the fact that units would EVER be involved with the "midlevel" in principle. Bump height comes from values of gray FIRST, not some distance which has nothing at all to do with gray level until the end. The only time units come in is when you say, for instance, that 50% gray is no height (your midlevel) , pure white is max + height (+1) and 100% gray is maximum -height (-1). THEN you CAN apply a scalar to the gray level % that says that the heights are +-% * desired units. If you set your zero-height at 100% gray (black), then the range is 0 to +1 and again you can use Gray level % * unit scalar.
But saying, for example, that midlevel = 20cm makes no sense at all.

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Fri Jan 04, 2013 12:58 pm

there is no native unit system. 1 unit is 1 unit. The value "5" imports as 5 Blender units.
I'm sitting, waiting, wishing, building Blender in superstition...

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Fri Jan 04, 2013 9:42 pm

there is no native unit system. 1 unit is 1 unit. The value "5" imports as 5 Blender units.


OK, on the surface that definitely simplifies things. But it also makes the situation more confusing in that units are offered in Blender. If those units are offered as a global units system to override Blender's unit-less system, that idea makes sense. But if it is only meant to be applied to some PART of Blender, like for displacement, that does NOT make sense if there are no global units beyond Blender's unit-less system.

And it still does not address why Blender offers the option of interpreting midlevel as being measured in some system of units (Please see my last post up).

But it is even more messed up...Even if you go "unit-less", the midlevel slider can go above and below value "+-1". In fact, the slider has infinite +- range. Without being normalized to "+-1" as maximum/minimum, there is no constraint on the range to tell Blender what degree of displacement corresponds to any particular gray level.

This really sounds and looks like a bug to me.

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Sat Jan 05, 2013 10:55 pm

Can anyone comment on this? I am trying to get my mind around it, because the results I am getting for displacement are unpredictable. There is no easy way to set up a particular gray level to be zero-displacement, so I find that even those areas in the grayscale image that should not displace, in fact do, and that messes up how objects fit together, especially if they have close tolerances.

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Sun Jan 06, 2013 3:28 am

if you really want to get rid of this, compile blender yourself with the following edit:

BlenderSVN\blender\source\blender\makesrna\intern\rna_modifier.c

line 1669:

Code: Select all

prop = RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);


change PROP_DISTANCE to PROP_NONE (it's for the subtype)

As long as it's PROP_DISTANCE, it will use the set unit system (0.0-1.0 for None, otherwise meters or feet). Without, it should treat the value always as 0-1 float range (normalized)
I'm sitting, waiting, wishing, building Blender in superstition...

treddie
Posts: 23
Joined: Thu Jan 03, 2013 9:51 am

Postby treddie » Sun Jan 06, 2013 6:56 am

Thank you very much CodemanX.

I just checked the site for dev tools and will give it a try!


Return to “Interface & Tools”

Who is online

Users browsing this forum: No registered users and 1 guest