CGTalk > Software > Autodesk 3ds max
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 10-23-2012, 04:58 PM   #1
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Weird seams around normal map when placed on a plane.

So I am trying to create sprites from models, rendering them both as diffuse textures and then with a Normal TexMap to extract normal maps from the object. However I've run into a rather annoying issue. When moving lightsources around, parts of the normal map that should be dark always have a white outline which I can't fix.

Here's an example and my workflow:

Edit: Please note that these spheres are not the models I'm working on. I did not want to post them so I simply created a simple example to show the issue I'm having. These renders are only made for this post.

1. First I create a model (for this example, 3 spheres)


2. I then apply "Normal TexMap" material to them and render. That gives the following results:


3. I apply the normal (pictured above) and opacity maps to a plane and add a lightsource and move it a little bit to one side like so:


4. The results are this:


Note the bright outline on the right side of the spheres. How can I get rid of it? I've tried playing with different filters, turning AA down and up, the blur in the "coordinates" tab of the normal map. I've even changed renderers with no luck yet.

I'd appreciate if someone could give me some points on how to get rid of those seams or even just pointing me to a better workflow to create "sprites" from 3d models.

Thanks.

Last edited by l3ftnut : 10-24-2012 at 07:10 PM.
 
Old 10-24-2012, 11:57 AM   #2
robinb
Expert
 
Join Date: Jul 2003
Posts: 2,908
Could you post the normal map too?
 
Old 10-24-2012, 05:00 PM   #3
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Thanks for the reply RobinB.

I'm not sure if my links in the previous post didn't work but the normal map I'm using is the second picture I posted. I apologize if the pictures did not work or if I wasn't clear enough. Here it is again (hope it works):



I seem to have accidentally saved it for this example with alpha background. However that is not the issue as far as I know. I have tried to both save the picture without alpha enabled and changing the background colors in Photoshop without any change.
 
Old 10-24-2012, 07:23 PM   #4
robinb
Expert
 
Join Date: Jul 2003
Posts: 2,908
I saw it before, but I can't see it now. I couldn't tell if that was the actual map or not with the alpha channel. If there is an alpha channel in the map, is the transparent bit flat blue? I wonder if pre-multiplied alpha is causing problems.
 
Old 10-24-2012, 07:37 PM   #5
Noren
Expert
 
Noren's Avatar
 
Join Date: Jan 2003
Posts: 488
You probably need padding in your normalmap.
Also png might be a problem if that's the very map you are using.
 
Old 10-24-2012, 07:43 PM   #6
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Thanks again RobinB.

Hmm.. I think the transparent stuff is black. I tried changing the background to the more common blue in photoshop, without any luck. Example here: http://imageshack.us/a/img211/1003/444ui.png

When I disable the alpha channel, the rendered background is black. However the problem remains. Example: http://imageshack.us/scaled/landing/202/222wl.png


The weird "edge" is always the same. Could it be the format? I only use .PNG.
 
Old 10-24-2012, 07:44 PM   #7
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Thanks for the reply Noren.

Ofcourse I should have tried a different format. I was in fact using PNG's for everything. I will try to use a different format when I get home and see if that helps.
 
Old 10-24-2012, 08:29 PM   #8
Noren
Expert
 
Noren's Avatar
 
Join Date: Jan 2003
Posts: 488
Theoretically one non premultiplied alpha .tga with black background should be fine.
Your alpha will be anti-aliased and your color information (for the normals) will be aliased, giving you all the data you need.
When applying your texture you can choose which channels Max will read out, if it it's a premultiplied alpha, if it should use the alpha, if it should be filtered and so on.

Depending on the filtering and how Max handles that exactly, you might still need to enhance the borderpixels of your normalmap, though. No matter if black or blue, if Max decides to sample from a pixel outside your blobs, it will look wrong.

If you use render to texture to render from a plane instead of the usual way you can choose to add "padding" right away. You'll have to render your anti-aliased alpha in a seperat pass, though, if I recall correctly. )
Or you could use some script in Photoshop or a similar program for it. (Edge dilation is another term for it that might come in handy. xNormal comes with a script/plugin like this, for example.)

Last edited by Noren : 10-24-2012 at 08:31 PM.
 
Old 10-24-2012, 08:37 PM   #9
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Thank you again!

Alpha channel is not a requirement for what I'm trying to do. It was simply a mistake from my side, I forgot to uncheck the alpha option when I did the rendering for this thread. I did not notice it until after I had posted.

You have given me some ideas which I will play with tonight and hopefully everything goes well.

Are there any known problems with the PNG format which could be causing this? Or more specifically, the way 3dsm creates PNG images?
 
Old 10-25-2012, 11:50 AM   #10
robinb
Expert
 
Join Date: Jul 2003
Posts: 2,908
I would stay away from PNGs with alpha. I know that photoshop fills fully transparent pixels with pure white, regardless of what colour they were before bringing them in. Max might do the same. And that might cause this sort of problem. Bake your map to an opaque texture with the mid blue background (shouldn't matter which format then) and keep the alpha on a separate texture and see what that looks like.
 
Old 10-25-2012, 08:01 PM   #11
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Thanks guys! I think I've found the problem thanks to the both of you.


Basically when I'm saving PNG's from 3dsm, edges seem to get anti aliased (I'm not sure if that's the correct term for what's happening) however images in Targas format do not. I can convert the Targas to PNG in photoshop without the edges getting smoothed out and they'll work fine as normal maps.

It seems that just PNGS saved from 3dsm itself are causing the issue. I wonder if there's any way to disable the smoothing from happening when you save a PNG from 3dsm?

Here's a close up of the edges. In case the above picture isn't working here is a link: http://imageshack.us/scaled/landing/51/tgavspng.jpg
 
Old 10-26-2012, 11:34 AM   #12
robinb
Expert
 
Join Date: Jul 2003
Posts: 2,908
What's the black around the object? That should be mid blue (127,127,255). Black is an invalid colour for tangent space normal maps so if some of that bleeds through you will get artifacts.
 
Old 10-26-2012, 05:14 PM   #13
l3ftnut
Veteran
 
l3ftnut's Avatar
portfolio
G
RVK, Gambia
 
Join Date: Jun 2009
Posts: 52
Thank you RobinB. I really appreciate your help.
I will change the background to the midblue color.

I'm still wondering though if the smoothing/anti aliasing that 3dsm does when saving .pngs can be avoided?
 
Old 10-26-2012, 11:41 PM   #14
Noren
Expert
 
Noren's Avatar
 
Join Date: Jan 2003
Posts: 488
Quote:
Originally Posted by robinb
Black is an invalid colour for tangent space normal maps

Not necessarily. It basically just means the surface is pointing away from us. (Good for translucency effects for example. )
(127,127,255) points towards us and is closer to the average color of your usual normalmap, but to avoid artifacts altogether you need padding.

Last edited by Noren : 10-26-2012 at 11:43 PM.
 
Old 10-26-2012, 11:41 PM   #15
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:19 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.