Jump to content

Ambient Occlusion Artifacts + Weirdness


Recommended Posts

So I've finally gotten some time to sit down and work on the AO and texturing for my engine, but I'm getting some black spots and seam lines in places and I'm not sure how to fix it..

I think I've narrowed down that the seam lines are from identically duplicated UV islands overlapping, and the black spots from faces intersecting while not connected to each other. The overlapping islands I can't really help because of the limited texture map space, so is there a workaround for this and the seam lines?

Examples:

v9PD87H.png

gmvBsAj.png

24Hv7pg.png

I'm also getting this weird behavior with the object view where, no matter where I look, I can only see the engine mesh on top of the other meshes. Did I accidentally activate a feature, and how can I turn it off?

IXnEdEE.png

Link to comment
Share on other sites

can try increasing your shadow map resolution, or whatever the blender name is. it will take a little longer to bake, but not as long as it will take to make your mesh 100% contiguous.

Edited by nli2work
Link to comment
Share on other sites

That's perfectly normal for intersecting meshes, for whatever is inside the other mesh, AO is rendered dark, due to resolution limits the dark bit bleeds forth through the intersection, causing the dark pixelated borders.

When this happens I usually just blur the relevant bits of the texture a bit by hand and everythings fine.

Link to comment
Share on other sites

That's perfectly normal for intersecting meshes, for whatever is inside the other mesh, AO is rendered dark, due to resolution limits the dark bit bleeds forth through the intersection, causing the dark pixelated borders.

When this happens I usually just blur the relevant bits of the texture a bit by hand and everythings fine.

What always bothered me is why the dark bleeds through, and not the other way.

Link to comment
Share on other sites

I know of a few ways to mend the dark spots.

first, Turn on backface culling under shading.

1: temporarily subdivide your mesh for baking. That should atleast reduce it(to simplify hard edge tagging select-select sharp and set edge crease to 1)

2: seperate the objects that intersect temporarily and bake seperatly(render other objects hidden)

3: bake to an oversized texture then reduce afterwards.

4: like porkjet said. Fix post-render.

hope this helps.

Link to comment
Share on other sites

3: bake to an oversized texture then reduce afterwards.

4: like porkjet said. Fix post-render.

Ok interesting, I will try that too and see what happens :) I did use the post render way on my most current texture below:

4ZOpjPs.png

I think it's coming along pretty well for my first part, but could still use improvement. I'm having trouble with the specular map, as I'm not sure where to put it in GIMP/Unity, and I have yet to do the emissives for the nozzles. Also as far as the pistons that move with the gimbal...do I have to add hinges or joints in Unity to make them function?

Edited by Quiznos323
Link to comment
Share on other sites

spec map go in the diffuse's alpha channel. in the specular shaders's Main_Tex you will see RGB(A); indicating Alpha channel is being used for specular intensity. specular size is controlled by the glossy slider and is global to the material.

Link to comment
Share on other sites

Also as far as the pistons that move with the gimbal...do I have to add hinges or joints in Unity to make them function?

I'm not sure if it's possible to make functional hinges/pistons with animation for the gimbal. I could be wrong. My experience so far is that the gimbal is 100% just rotating the transform around its origin, so it just tilts the engine bell (or whatever mesh) that is a child to your thrust transform.

So I'd position the thrust transform at the top of the bell, and make the bell mesh a child of it.

- - - Updated - - -

I think it's coming along pretty well for my first part, but could still use improvement.

BTW, are you kidding? That looks fantastic. Better than a lot of what I do. ;) But yeah, once you get the specular and emissive going, it'll be awesome.

As nli2work was explaining, use your texture's alpha channel. White/opaque on this channel corresponds to highly reflective, and black/transparent equates to flat or non-reflective. So you can control the relative sheen very well. Often as a quick-and-dirty starting point, I'll copy the "diffuse" (the actual texture) into the alpha channel (photoshop will automatically convert it to monochrome in the process), and let the darker areas of the image be less reflective. But like I said, that's just a starting point, and I'll manipulate it quite a bit.

For the emissive, usually you can get away with a much smaller resolution. The stock parts often use an emissive that is half or quarter of the linear resolution of the specular/diffuse texture. Here, black equates to "doesn't glow", and white is "glows a lot". This can be an 8-bit monochrome texture, and you'll set the actual glow colors in Unity, and since this is a heat animation on an engine, you'll create it as an animation in Unity with the colors added via keyframes.

Edited by NecroBones
Link to comment
Share on other sites

I'm not sure if it's possible to make functional hinges/pistons with animation for the gimbal. ...BTW, are you kidding? That looks fantastic.

I have seen it done a lot in Ven's parts in his stock revamp mod and in Porkjet's Nuclear Lightbulb engine. They use the FXModuleLookAtConstraint module, and I have tried to use it, but either the piston segments stay put and do nothing as they gimbal with the nozzles, or they freak out and float away from the engine in random directions... I've been trying to read bits and pieces about it in Cpt. Kipard's Skylon landing gear thread but I'm not quite grasping how the objects need to be aligned in Blender/Unity in order to point at each other correctly.

And thanks!

As nli2work was explaining, use your texture's alpha channel. White/opaque on this channel corresponds to highly reflective, and black/transparent equates to flat or non-reflective. So you can control the relative sheen very well. Often as a quick-and-dirty starting point, I'll copy the "diffuse" (the actual texture) into the alpha channel (photoshop will automatically convert it to monochrome in the process), and let the darker areas of the image be less reflective. But like I said, that's just a starting point, and I'll manipulate it quite a bit.

Alright, the white and black controlling reflectiveness/opaqueness makes sense to me, I'm just having trouble physically finding where the alpha layer is in GIMP and applying it haha... In my GIMP file I have multiple layers to my texture, two of which being the bump and spec layers set to be invisible just so I have them there for reference. Do I need to export the texture as one file and apply the alpha to that, or can I do it with all of those layers in the original GIMP .xfs file? I really am new to all this paint software, so sorry if I have a bunch of questions XD

It looks nice but I'd recommend that you don't showcase your parts rendered, and screengrab a Unity preview instead, just to give people a realistic expectation.

Yeah, probably a good idea.

Edited by Quiznos323
Link to comment
Share on other sites

adding alpha channel in GIMP; they should be editable just like any other layer after you add it, I tend to copy/paste a diffuse into the alpha as a starter before adjusting contrast/brightness; levels; etc.

FXLookConstraint points the the mover object's +Z toward the target transform. your initial mover transforms have to be rotated such they are aimed a the targets when at the neutral orientations. you can align the pivots in blender and use the mesh objects directly as movers, or you can add additional transforms in Unity as mover objects (child the mesh to the mover objects you've added). the rotation of the target objects is not important, only their position. the target object child of thrustTransform (or engine bell), which is moved by ModuleGimbal; and the piston objects to rotate in order to aim at the targets. if an transform involved in a constraint module flips rapidly or drifts off into space it's most likely caused by circular constraint ( a bit like infinite loop in code). you need to step through your heirarchy and make rearrangements if that's the case.

Link to comment
Share on other sites

FXLookConstraint points the the mover object's +Z toward the target transform. your initial mover transforms have to be rotated such they are aimed a the targets when at the neutral orientations. you can align the pivots in blender and use the mesh objects directly as movers, or you can add additional transforms in Unity as mover objects (child the mesh to the mover objects you've added). the rotation of the target objects is not important, only their position. the target object child of thrustTransform (or engine bell), which is moved by ModuleGimbal; and the piston objects to rotate in order to aim at the targets. if an transform involved in a constraint module flips rapidly or drifts off into space it's most likely caused by circular constraint ( a bit like infinite loop in code). you need to step through your heirarchy and make rearrangements if that's the case.

So the +Z that you are referring to is the axis in Unity? So say that I want my mesh to be in the neutral position in Blender (all pistons pointed at each other and gimbal is 0), I could just add the mover objects with their +Z pointed at the target in Unity and child the meshes to them without messing with their orientation?

Edit: Yep it is +Z in Unity and I have the pistons on one nozzle fully functional. *In an evil voice* Hehe it is all coming to plan...

Edited by Quiznos323
Link to comment
Share on other sites

Btw. I just thought of something. Your render looks nice so youll want to keep this layout for this model. But for next time,

here:v9PD87H.png you have the oppertunity to merge geometry quite easily without adding extra geo and be able to use tiling for the round section. I dont have access to a computer right now but ill try to explain. First select the center loop of the horisontal ring. Grow the selection once and detach (p selected) select the detached obj in object mode and duplicate it. Hide the duplicate and select the end loop of the vertical tube. Make sure the tube is unwrapped. Slide it(gg) up so it is not touching the detached piece of horizontal tube. Detach it and add the shrinkwrap modifier (target the detached piece of the horizontal tube with projection mode) apply the mod and join it to the detached piece. Now depending on how far away the outer edges and the ring edges of the detached piece is from the joined vertecies you may want to add an extra loop in the middle between the two. Afterwards delete half of the piece + end loop and mirror modifier it. Now turn on snap(to vertex active) and snap vertecies from the center loop of the detached horizontal piece to the loop from the vertical tube. Apply the mirror and unwrap it. Now attach the object to the vertical loop and bridge between the hole and the tube end. Slide the extra loop down all the way and select all, remove doubles.

Now that i explain it it sounds complicated. But it takes less then 30 sec to do. Afterwards you can delete the horizontal tube if you want to use tiling textures. Rotate the detached piece you hidden earlier with snapping enabled and create a circular array of it around where the tube used to be. Hope it helps

Update. I just saw that the loops are out of alignement. Youd need to rotate the horizontal tube to match the center of the vertical tube before doing anything

Edited by landeTLS
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...