Jump to content
The Dark Mod Forums

Something wrong with "fit" on decals?


Recommended Posts

I'm not sure if this is an error or if I just have something set up wrong. I was placing some dirt decals, and noticed that if I used the "fit" texture command, the texture looks like it is offset by a few pixels. The image below shows an example--there is a black line at the top edge of the decal (which should be completely transparent) . It's as if the whole texture has been shifted down one pixel.

 

Any idea what might be causing that? Are other people seeing the same?

post-9-0-49850900-1410119071_thumb.gif

Link to comment
Share on other sites

Hmm, I've looked at the original image up close and I can't see anything dark along the top edge.

Link to comment
Share on other sites

The bottom of the texture is bleeding over to the top

 

That's what it looks like, but when you "fit" a texture, it's not supposed to do that.

Link to comment
Share on other sites

I'm not talking about how the texture is mapped. I'm talking about how the texture is filtered. To clarify...

 

 

Here we have Quake 2 running in software mode. No texture filtering takes place. The pixels in each texture are easily identifiable. Now jump ahead to 3m59s. Here it's running in hardware mode. The textures are blurry. The color values are not simply sampled from the nearest pixel within the texture. They are interpolated.

Link to comment
Share on other sites

Here's what DR writes to the map file for the decal (after cleaning up the floating point screwiness):

 

patchDef3

{

"textures/darkmod/decals/dirt/dripping_slime05"

( 3 3 1 1 0 0 0 )

(

( ( 128 128 -40 0 0 ) ( 128 128 12 0 -0.5 ) ( 128 128 64 0 -1 ) )

( ( 128 32 -40 -0.5 0 ) ( 128 32 12 -0.5 -0.5 ) ( 128 32 64 -0.5 -1 ) )

( ( 128 -64 -40 -1 0 ) ( 128 -64 12 -1 -0.5 ) ( 128 -64 64 -1 -1 ) )

)

}

 

 

I can't find the patchDef3 format on the web. Who knows how to interpret this? The 0.5s and 1s look dodgy.)

Link to comment
Share on other sites

* a patchdef is

 

 

Code:

{

patchDef2

{

"texturepath"

patchparams2

(

list of patchcoldefs

)

}

}

 

or alternately

Code:

{

patchDef3

{

"texturepath"

patchparams3

(

list of patchcoldefs

)

}

}

 

 

 

* a patchparams2 is

Code:

( #cols #rows junk junk junk )

 

where "junk" is an integer that is ignored.

 

 

* a patchparams3 is

Code:

( #cols #rows #horiz-subdivisions #vert-subdivisions junk junk junk )

 

where "junk" is an integer that is ignored

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Oh sorry forgot the rest of the post.

 

a patchcoldef is

Code:

( list of controlpoints )

 

* a controlpoint is

Code:

( x y z s t )

 

where x y z are the spatial coordinates of the point, and s t control the texturemapping in ye olde biquadratic Bezier fashion.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

When using the plaster texture instead of the dirt decal, the map file has this:

 

patchDef3

{

"textures/darkmod/plaster/framed_01"

( 3 3 1 1 0 0 0 )

(

( ( 128 128 -40 0 0 ) ( 128 128 12 0 -0.5 ) ( 128 128 64 0 -1 ) )

( ( 128 32 -40 -0.5 0 ) ( 128 32 12 -0.5 -0.5 ) ( 128 32 64 -0.5 -1 ) )

( ( 128 -64 -40 -1 0 ) ( 128 -64 12 -1 -0.5 ) ( 128 -64 64 -1 -1 ) )

)

}

 

which has the same numbers in the description.

 

So at first blush it doesn't appear that DR is writing something wrong to the map file.

Link to comment
Share on other sites

What we're seeing is a blending of the top pixel row with the bottom pixel row, which makes sense for tiled textures (because that's what you'd want to happen at the transition edge).

 

So in my pics above, the top and bottom rows appear to be exchanged because the dark top row has blended with the transparent bottom row, making it lighter, and the transparent bottom row has blended with the dark top row, making it darker.

 

I made a texture with a single pixel red line across the top and a single pixel green line across the bottom.

 

Here's what it looks like in DR when they meet:

 

post-3633-0-93170500-1410184959_thumb.jpg

 

You might be able to see the sort of yellow blended line between the red and green bands.

 

Here's what it looks like at the top (notice the presence of the blended yellow line):

 

post-3633-0-13401400-1410185080_thumb.jpg

 

and the bottom (notice the presence of the blended yellow line):

 

post-3633-0-39459600-1410185230_thumb.jpg

Link to comment
Share on other sites

So when any texture is painted on a face and 1x1 fitted, all four edges are exhibiting the effect.

 

For non-decal textures, we prolly aren't going to notice the effect.

 

But for decal textures with alpha channels, we might see it, depending on what the image is doing at the edges.

Link to comment
Share on other sites

The only solution I can see is to turn off blending in the horizontal direction if the texture is 1xN fit on the face from left to right.

 

And turn off blending in the vertical direction if the texture is Nx1 fit on the face from top to bottom.

 

If that's possible, then the OP 1x1 dirt decal would not show blending at any of the four edges.

Link to comment
Share on other sites

Why is blending even necessary? Tiling textures should already be designed to blend seamlessly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...