Page 1 of 1

Decal Blending Problem

PostPosted: Thu Aug 01, 2013 12:04 pm
by Justintime9
Hey guys, so I've been trying to do some decal blending, but there's a rather annoying problem. In URU, depending on the angle the camera is, it either looks like it should, or looks all wrong. At first I thought it was a passindex problem, and that solved part of it, but it still does this.

Here's how it looks when it's good. (Yes, that's actually 2 textures. It looks perfect.)

Image


But from the other angle it looks like this:

Image

I'm pretty sure I did everything right for the settings. The vertex color "Col" layer is all white, and the "Alpha" layer is all white except for the bottom, which is painted black to be the transparent part.

I used this tutorial if it matters: http://www.guildofwriters.org/wiki/Decal_Blending

Re: Decal Blending Problem

PostPosted: Fri Aug 02, 2013 5:34 am
by tachzusamm
Hard to help without knowing all of your settings. You stated they are all correct, but how can we know what's set up strange then?

First question: You said you used passindex. Did you use passindex INSTEAD of ZOffset?

Second question: Did you give the top mesh a ZOffset, and did you check ZTransp.?

Third question: Is that top mesh - that one with the border texture - a single face over the full length, or did you subdivide it?

Fourth question: Did you move the top mesh a bit in front of the other?


By the way, I've had troubles using that tutorial too. It was very difficult to get it right. So I refrained from using vertex alpha, and I use stencils instead.
Here's how:
a) You have to use two textures: 1. the stencil mask, 2. the texture to blend in.
b) Set up the stencil: Material: Shadeless, A:0.000, Map to: Alpha (rest off), check Stencil and NoRGB. Map input: an UV map with unwrapping "project from view(bounds)".
You can use a second UVmap for your real texture if you like.
c) Put you stencil into the first texture slot, the real texture goes into the second exture slot.

Re: Decal Blending Problem

PostPosted: Sun Aug 04, 2013 8:14 am
by Justintime9
Ok, well I didn't have ZTransp checked, and ZOffset was not set to anything. But I tried that just now and it didn't seem to change much. So far the best result I've gotten is with passindex set to 6 (Probably excessive, but w/e.) And the mesh is not subdivided. It is also a bit in front of the others. So perhaps stencils would be better. I've done those in the past.

Edit: Actually I just checked, and it has been subdivided. Is that important?

Re: Decal Blending Problem

PostPosted: Tue Aug 27, 2013 9:49 am
by Justintime9
Ok, well I tried to make a stencil, and that failed miserably. So I guess my best bet now is just to figure out the decal. :P As I said, the mesh is subdivided multiple times. I did originally have passindex instead of zoffset, and that is what produced the results I showed at the beginning of this thread. But when I got rid of passindex, and set zoffset to 1, the decal mesh basically vanished in game, except for a sudden flash from a single angle. :P Any idea what the problem is?

Re: Decal Blending Problem

PostPosted: Tue Aug 27, 2013 10:51 am
by Jojon
Probably irrelevant in your situation, but one thing worth keping in mind, in these dark arts, is to make sure that any static meshes that are to blend and are part of different objects, is to place the origins of both objects at the exact same spot in world-space, to minimise the levels of cumulative rounding precision loss. (EDIT: ...all the way to the point that if you copy the centre location of one object to another, you may need to go over every vertex afterwards, to make sure the "pairs" are properly aligned.)

If fiddling with passindex proves insufficient to get things working, it seems to me that sometimes it helps to become a bit more heavy-handed and separate minor render levels, using alcscript. http://www.guildofwriters.org/wiki/Managing_Transparent_Objects

If the base mesh and the decal are instead both part of the same mesh, materials appear to be drawn in the order you have indexed them for the mesh -- material one draws first, then two, on top of one, and so on.

Re: Decal Blending Problem

PostPosted: Thu Sep 05, 2013 7:24 am
by Justintime9
Ok, well either I just don't understand transparent objects, or it's just not working. :P Anyway, I found an alternative. Rather than using decal blending, I just went into Photoshop and edited the texture itself to fade into transparency. So that seems to work pretty good.