Author Topic: squished silhouettes  (Read 5412 times)

Lech Switala

    Reputation: 3
squished silhouettes
« on: June 21, 2011, 09:46:12 am »
June 21, 2011, 09:46:12 am
Can somebody tell me how to avoid the squishing of my silhuettes? I wanted to personalize my scene with some silhouettes of people I know.  I created a (Nvidia) DDS with the alpha channel, used it as a material on a single plane/face.  As you can see the original is about 1.4 taller than the Lumion silhouette.  I also have problems with geting rid of the black edges.  I'd welcome very much any advice.


    Reputation: 29
Re: squished silhouettes
« Reply #1 on: June 21, 2011, 11:15:57 am »
June 21, 2011, 11:15:57 am
squished people:
I think this prob comes out of the modeling-software.
Make sure that the plane, on which you mapped the silhouettes, has the same proportion of width-height like your map.
You can also edit the mapping-coordinates in your modelling software until you like the proportion.

black edges / pixel:

I suppose you work with the Nvidia-DDS-plugin for photoshop.
This plugin copies all black areas from the alphachannel to the RGB-channel. So the background  turns black.
And if the white areas of the alphachannel aren´t 100%-correct (which will never be), so some pixels of the black background are displayed....
Save a silhouette with a white background as dds and reopen the dds and you will see what i mean.
Its a bug in the DDS-plugin of Nvidia.

Additionally bear in mind that Lumion only uses 1-bit-alpha (only black-white, NO greyscale). That means, if you create the alphachannel, it may be that at the border of white and black a small area of grey is generated.
This border-area will be computed automaticly to white or black in the Nvidia-DDS-plugin (if you choose 1-bit-alpha) or in Lumion itself (if you choose premultiplied alpha, f.e.). The decision, which of the greyscale-pixel turns white or black (displayed or not displayed) will be made by the software. And so some black pixels of the DDS-background will appear.

You can avoid this by saving the file as TGA, so you can use the background-color you like. White may be better, because if the alphachannel isn´t 100% accurate, there are displayed white pixels. Theire less annoying than black pixels.

workflow image-editing:
1. extract the visible areas with selection tool,
2. shrink the selection 1 Pixel,
3. create the alphachannel,
4. fill the selection with white in the alphachannel,
5. adjust contrast of the alphachannel to maximum to avoid grey areas at the borders,
6. save as TGA to keep your backgroundcolor in the RGB-channel
    or save DDS choosing 1-bit-alpha in the plugin (when a black RGB-background isn´t annoying).

Hope this helps.

Re: squished silhouettes
« Reply #2 on: June 21, 2011, 12:11:45 pm »
June 21, 2011, 12:11:45 pm
To avoid the black edge, you need to add padding to the edges of the cut-out image. Here's one way of doing this:

1) Duplicate the cut-out layer
2) Blur the copy a little bit, e.g. with Gaussian blur
3) Duplicate the blurred version 20 times and collapse the duplicate layers, so you have a solid but slightly blurred version of the original cut-out layer which is say, 5-6 pixels wider than the original layer all along the edge.
4) The original cut-out layer should be moved to the top of your layer stack (use a 100% bright version of this layer for the alpha channel as usual) and place the blurred (collapsed) layer at the bottom of the layer stack
5) Make sure the texture is a power of two, e.g. 256x512 and save it as a DDS file (Lumion uses 1-bit alpha, so DXT3 is the best choice in terms of compression quality vs memory usage. If memory consumption isn't an issue, you can just save a 32-bit TGA or PNG file and any resolution you want up to the maximum that your graphics card allows, e.g. 4096 pixels)

Lech Switala

    Reputation: 3
Re: squished silhouettes
« Reply #3 on: June 21, 2011, 12:27:38 pm »
June 21, 2011, 12:27:38 pm
Thank you for your solutions regarding the black edge. I am sure it will work. I still have the problem of the squished image.  I tried using the proportional plane but to no avail.  The DDS texture comes with a whole array/grid of images.  I rescale (unfortunately in both directions only), use the x and y coordinates (to move the image), but the image is still vertically squished.  Enclosed the original DDS image.

Btw, how can I make a rotating billboard out of this image (unsquished)? When I apply the billboard button the image goes wild and revolves around a random pivot point, not the sight origin point.

Re: squished silhouettes
« Reply #4 on: June 21, 2011, 01:03:48 pm »
June 21, 2011, 01:03:48 pm
You need to create a vertical plane which is the same aspect ratio as the original photo. Just use the pixels of the photo as a guideline, e.g. 1256x2020 pixels = 1,256m x 2,020m and scale this so the people are roughly the correct size. Make sure the plane faces the front view in your modelling application. Apply the texture to the plane so that it stretches all the way to the edges of the plane (In SketchUp, right-click on the plane -> Texture -> Position). Then export the model to DAE or FBX format, import it in Lumion and apply the billboard material.

By the way, the cut-out texture is of a rather poor quality (check out the white bits near the hair). In addition to the technique I described above, you may need to trim and clean up the edges manually.


    Reputation: 29
Re: squished silhouettes
« Reply #5 on: June 21, 2011, 01:19:49 pm »
June 21, 2011, 01:19:49 pm
You have to cut out your silhouettes more properly,
by hand not by wand... ;)
Have made some screenshots showing what causes the black pixels.


    Reputation: 29
Re: squished silhouettes
« Reply #6 on: June 21, 2011, 01:22:32 pm »
June 21, 2011, 01:22:32 pm
...oops, Morten, you were faster.

Re: squished silhouettes
« Reply #7 on: June 21, 2011, 02:06:20 pm »
June 21, 2011, 02:06:20 pm
To remove the black edges just cut out more accurately and use "remove black matte" in photoshop. Save the resulting image as a 24 bit PNG with alpha and voila, the image is ready to use as billboard.

Lech Switala

    Reputation: 3
Re: squished silhouettes
« Reply #8 on: June 22, 2011, 01:07:31 am »
June 22, 2011, 01:07:31 am
Thanks guys!!!  I did some further tests, taking your advice into consideration.  The way I tried to create a billboard, before I called for help,  was to import a neutral plane into Lumion and then apply the dds, tga, png whatever onto it.  This does not work!  The plane I imported had the right proportions, just like you told me, but the material I applied still had the squished effect.  Then I went back to Sketchup and I created a billboard there (with texture) and imported as a DEA - this worked!!!  I also applied a mesh (fence) texture to a plane in Sketchup, set it at 0,0,0 front view and imported - success!  I applied the "billboard" material - the texture went wild (see pic). There is something in Lumion as far as applying texture materials in Lumion is concerned which needs to be looked at.  The textures are disformed.
Importing a textured plane into Lumion - no problem.
The cutting out methods work, although 1 pixel tolerance is only 1 pixel. 

Re: squished silhouettes
« Reply #9 on: June 22, 2011, 11:41:18 am »
June 22, 2011, 11:41:18 am
Billboard issues:
I wasn't sure whether you were using 3DS Max or SketchUp, since planes made in 3DS Max can be converted to billboards without problems in Lumion SP2.

However, thanks to your persistence, I've now tested the SketchUp -> Lumion -> Billboard material and you are not going crazy, this functionality does appear to be broken in SP2 - when I add a Billboard material to a plane from SketchUp the plane becomes 100% white, and fades out if you move away from it. It does however face the camera as usual.

This was not a problem in Lumion SP1, so I'll forward the files to Artur, our import/export guru, so a fix can be provided as soon as possible - hopefully in Build 3 this week!

Apologies for the time you've spent on trying to fix this problem.

(I will investigate the aspect ratio problem now)

Re: squished silhouettes
« Reply #10 on: June 22, 2011, 12:31:41 pm »
June 22, 2011, 12:31:41 pm
By the way, regarding the wire mesh fence in the middle, you can't create a billboard using a tiling texture in Lumion SP2 and onwards. This is intentional and was done to eliminate artifacts that otherwise appear along the edges of billboard planes.

In other words, when using a billboard material, the texture you use has to extend all the way to the 4 corners of the plane. So if you need a wire mesh fence as a billboard, you will need to make the full mesh fence texture manually by copying the small wire tile x times in Photoshop.

Apologies for the inconvenience, but we had to choose between allowing tiling textures as billboards or eliminating the edge artifacts on billboards.

Re: squished silhouettes
« Reply #11 on: June 22, 2011, 01:13:48 pm »
June 22, 2011, 01:13:48 pm
Regarding the aspect ratio, I need more information from you to be able to reproduce this problem.

On your screenshot I can see that the people on the far right are tiling twice vertically.

Please go through this step-by-step procedure and let me know what you do differently:

1) I create a 1,256m x 2,020m plane which faces the front view in SketchUp.

2) I create a new material, make sure the Lock Aspect Ratio (the chain icon) is on and add the texture (your 32-bit 1256 x 2020 pixel DDD file converted to TGA and/or PNG format since SketchUp doesn't support DDS).

3) I apply the material to both sides of the plane.

4) I adjust the texture so it reaches all 4 corners of the plane (Right-click on the plane -> Texture -> Position.

5) I export the plane to DAE format with all export options turned off apart from:
    - Triangulate All Faces ON
    - Export Texture Maps ON

6) I import the DAE file in Lumion SP2. The plane looks just like in SketchUp with transparency etc.
At this stage you can either investigate the aspect ratio problem or the billboard problem:

7A) To investigate the aspect ratio problem when replacing the texture, I try to apply a Standard material, and replace the imported texture with a random texture with an arbitrary aspect ratio. This works as expected (the new texture stretches to all 4 corners of the plane).

7B) To investigate the billboard problem, I apply a Billboard texture and the resulting bug, i.e. that the plane turns white and fades out as the camera moves away, has been reported on the internal bug tracker list as described in my post above.

If you do anything differently, please provide us with a more thorough description broken down into steps, so we can reproduce the problem :)

Lech Switala

    Reputation: 3
Re: squished silhouettes
« Reply #12 on: June 22, 2011, 10:41:59 pm »
June 22, 2011, 10:41:59 pm
First of all lots of thanks for taking the time!
The way it worked for me:
1. in Sketchup I create a plane/face/rectangle. If it's not in the same proportion than I see feet or heads of the next image of the texture. So I make the rectangle less wide or less high, so I see one copy of the image.  I can also define the size of the texture numerically by creating a texture material.

I go through step 2 till 3.

4. I didn't know about texture-position tool option, but the result is the same.

5. dito

6. dito until the moment I touch the Standard Material - Scale  slide, the texture shrinks and squished figures appear.  I move the slider back to extreme left, the original correct texture from Sketchup comes back. It's like two worlds.

7A dito

7B Applying the billboard texture to my imported from Sketchup plane+texture  turns my image INVISIBLE and only the correct shadow indicates that the texture is somewhere there. 

Reg. your post from 11:31:41 am:  first a general definition remark, when you say billboard you mean a still standing plane with a texture, not turning towards the camera.  Now the turning billboard is another situation and it should be called differently.  It's confusing to hear: apply the billboard material to a billboard. It rather should be:  applying the camera facing feature to a billboard with a texture, I guess.

Back to your post: when you say I can't create a billboard (the rotating kind?) with a tiling texture.  The png I used in Sketchup to create a material in order to apply to my plane/rectangle is tiled, no matter what I do.  Is there a feature called "applying a decal" to a plane in Sketchup/Lumion ? A decal is one only image, no tiling.

Another question, if I want to create a rotating billboard in Lumion using a still standing billboard created in Lumion /the texture applied in Lumion) - it does not work.

Morten, once again a lot of thanks for your effort in trying to solve these as they say in German "Kinder Krankheiten" -  after a period of refinements Lumion will be perfect, because you care.

Re: squished silhouettes
« Reply #13 on: June 23, 2011, 11:27:00 am »
June 23, 2011, 11:27:00 am
About the Billboard naming convention
Hehe, you're right, the way Lumion and other 3D applications use the word billboard is very different from the way the general public uses it. If I asked my girlfriend what a billboard was she'd say it's those adverts you see along the motorway :)

In Lumion however, a billboard is always a simple plane with a non-tiling texture that you have applied a Billboard material to. Once you've applied that material to the plane it rotates around 1 axis in an effort to always face the camera.

About the Scale slider in materials
Once you've applied a Standard material to your model (as per #6), try to move the mouse cursor to the blue question mark icon on the lower right corner. This is the contextual help function in Lumion. As you can see on the screenshot below, the help function explains that the Scale slider has two modes:

1) Use the original UV coordinates of the imported model when the slider is set to 0 or
2) Scale the texture with the slider value using the built-in AutoUV function which is supposed to apply a planar projection regardless of the orientation of the faces of the model.

I say "supposed to" because I can see that when you apply a Standard material to a simple plane from 3DS Max and SketchUp, and you adjust the material Scale slider the UV coordinates are only partially correct on 1 of the triangles :-\

Scaling a texture on a box from SketchUp works fine though, it's just single- and double-sided planes that are affected.

Either way, you have helped us find yet another bug, and I'll add this to the bug tracker list right away! Hopefully Remko and Artur can fix this problem in the upcoming Build 3.

The other bug, i.e. applying a Billboard material to a plane from SketchUp turns it white/invisible in SP2, has obviously already been reported and Artur was working on a fix yesterday. Perhaps the two bugs are related.

In any case, thanks again for your persistence - without you we wouldn't have found out about this problem! :)

Re: squished silhouettes
« Reply #14 on: June 23, 2011, 05:50:59 pm »
June 23, 2011, 05:50:59 pm
Next build has it fixed. The Squashed billboard is not something we can fix for you. Just make sure the plane in Sketch-up has the same aspect ratio as the image.