Applying scorch decals

Sage
Posts: 1,199
Joined: 2004.10
Post: #16
Thanks,

I wanted to show off it working, not that it's really impressive or anything but I've been focusing on this for several days and it makes me happy to see it pay off.

[Image: Legion-2005-03-31-02.jpeg]

The large blue sphere is the damage sphere, and the little "nipple" is the origin of the projection.

Anyway, I'm so proud of my little game engine. Love

I'm, like, *this* close to implementing bad guys. It's funny -- I built a testbed for their brains and developed a general framework for them back in october, but I've been focusing on having as fast and robust and engine as possible before putting them in and making a game out of it.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #17
One more question.

I've got it running in a general purpose way, now, managed by the scene graph and behaving well ( I have a stress test with 2000 "decals" running happily at 30fps ).

Now, looking at the screenshot you can see some texture edge-stretching occurring, due to my clamping the texture. (note that for my test texture, the opaque parts of the image do *not* extend to the edge of the texture.)

You can see what I'm talking about in the screenshot -- you can see a sort of faint "cross" over some of the circles.
[Image: Legion-2005-04-02-02.jpeg]

I see this distortion even with texture bordering set, though I can change the color of the unwanted stretching. Annoyed

Is there anything I can do about this, or would upping the alpha test threshold knock it out?
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #18
Your stuff looks awesome, its nice and stylish, keep it up. Grin
Quote this message in a reply
Member
Posts: 184
Joined: 2004.07
Post: #19
TomorrowPlusX Wrote:I see this distortion even with texture bordering set, though I can change the color of the unwanted stretching. Annoyed

Is there anything I can do about this, or would upping the alpha test threshold knock it out?

Did you try setting the constant border color to something completely transparent (alpha 0 or 1 depending on what alpha test you're using?) The pixels on the very edge of your texture might not have completely transparent values since it's somewhat hard to tell unless you break out gimp or photoshop to check their values.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #20
phydeaux Wrote:Did you try setting the constant border color to something completely transparent (alpha 0 or 1 depending on what alpha test you're using?) The pixels on the very edge of your texture might not have completely transparent values since it's somewhat hard to tell unless you break out gimp or photoshop to check their values.

Yeah, unfortunately. The border color was set to be completely transparent. Just to make certain the border functionality works I set it to opaque red and got the expected results. So, yes, setting border color to ( 0,0,0,0 ) ( apprently the default value, btw ) does nothing.

So, I tried upping alpha test value. Upping it to 0.1 ( GL_GREATER, 0.1f ) did the trick, but then the scorch marks look pretty crapulent!

So, I'm basically at a loss here. I find the effect shows up worst when looking at a fairly oblique angle, and mostly disappears when looking directly at it. Maybe I need to crank up the anisotrophy...

EDIT: That didn't do it. So far as I can tell, the best thing I've found to mitigate this ( not solve it ) is to set my border color to ( 0.5, 0.5, 0.5, 0 ). Crappy. I'm going to have to see if other cards do the same thing.
Quote this message in a reply
Member
Posts: 184
Joined: 2004.07
Post: #21
Perhaps if you inset your image somewhat and make several pixels on the border transparent, and then clamp to edge, you won't get artifacts (then you'd just need to make each circle a constant multiple bigger, which is no big deal.) Are your mipmaps being generated automatically? It is rather annoying this doesn't "just work."
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #22
Well, my image does have several pixels of padding ( with zero alpha ) already... but you thnk clamp to edge might fix this? The manpages make clamp to edge sound... not appealing for me here, but I guess it's worth a shot. Also, I do have my mipmaps generated automatically.

Anyway, I agree. It is annoying that this doesn't just work. What a pisser!
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #23
I highly suspect the mip-mapping as causing your artifacts, as the auto generation blurs the pixels, so you might end up with things you don't want. How do things look without mip-mapping?
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #24
Yeah, I suspect that's what's causing it. I guess my best bet is to either turn off mipmapping for the decals, or manually zero the alpha of the border pixels of the mipmap levels. PITA.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #25
DoG Wrote:Your stuff looks awesome, its nice and stylish, keep it up. Grin

Thanks, man!
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #26
So, to close this thread: It *was* mipmapping. I turned it off for the decal texture and the problem went away completely. Thanks for the help, guys!
Quote this message in a reply
Post Reply