At first I had forgotten to include the lightmap stage, but the flowers would show up in fullbright. I then included the lightmap stage, but the result is as follows:
I want to get rid of the dark squares surrounding the flowers (in brighter lit areas of the map, the squares aren't visible (or less visible)). Anyone know how to do this? The flower texture is applied to a small, thin brush that's positioned right on top of the grass surface.
Hey. pretty simple, you can delete the blendfunc and add just the "alphafunc ge128" and apply an alphachannel to the tga. everything thats black wont be drawn(you know for sure the technical background.) any other method will cause ugly results.
mfg kaffeewunder
I don't know a whole lot about shaders but in the map I just finished I had the same problem
and what I did to fix it was to get rid of the alpha channel and make it a negative image but
the shader isn't the same so that may not work in your case.
kaffee wrote:Hey. pretty simple, you can delete the blendfunc and add just the "alphafunc ge128" and apply an alphachannel to the tga. everything thats black wont be drawn(you know for sure the technical background.) any other method will cause ugly results.
mfg kaffeewunder
kaustic wrote:I don't know a whole lot about shaders but in the map I just finished I had the same problem
and what I did to fix it was to get rid of the alpha channel and make it a negative image but
the shader isn't the same so that may not work in your case.
Yeah that works with decals but there the entire texture is blended which kind of makes the decal not entirely opaque. I used this shader technique for the decals in my map, like stains or patches of dirt on the grass.
kaffee wrote:Hey. pretty simple, you can delete the blendfunc and add just the "alphafunc ge128" and apply an alphachannel to the tga. everything thats black wont be drawn(you know for sure the technical background.) any other method will cause ugly results.
mfg kaffeewunder
This is correct. You need to do an alpha-test, which basically says, take the texture's alpha channel and save it to the buffer, then also apply the same alpha channel to the lightmap stage as well. All the grates and other effects in Q3 work the same. The only pitfall is that it will not work if you have a full 8-bit alpha channel, where the texture requires different levels of opacity per pixel. alphaFunc is an all or nothing test, so a alpha channel pixel is either 100% opaque or 100% transparent and otherwise rounds the value to the nearest 1 or 0 value.
Another alternative if you absolutely need a full 8-bit alpha channel is to simply vertex light the surface or set a constant vertex colour value that approximates the lighting in the area. Then you can use a normal blendFunc blend and skip the lightmap stage altogether.
It works properly, but they do look a bit cardboard-cut-out-ey, but that's probably due to the everything or nothing way of how the alpha channel works. I guess it's good enough as it is now.
Eraser wrote:It works properly, but they do look a bit cardboard-cut-out-ey, but that's probably due to the everything or nothing way of how the alpha channel works. I guess it's good enough as it is now.
You can get rid of this effect if you color the background similiar to your object (dark green here).
Quick lookup here: http://www.cgtextures.com/content.php?a ... me=alphabg
Bliccer wrote:You can get rid of this effect if you color the background similiar to your object (dark green here).
Quick lookup here: http://www.cgtextures.com/content.php?a ... me=alphabg
He means the black square around the flower made by lightmap. Pretty ugly, the solution is to alphatest the flower with alphaFunc GE128 in the shader without soft blending (edges will be nasty sharp, as it was a model placed on the floor... That way it should look much better than with soft transition using soft blending with use of lightmap stage it's the case now in his EntityPlus map Survivour.
Yeah, what Bliccer said. I'm surprised how this isn't standard practice even among commercial game textures.
Also, if you're just placing those flowers on the ground like decals, that's not very realistic (I'm not sure if you're just testing the texture like that). Real flowers have stems and some sort of plant that it's attached to. It doesn't have to be particularly detailed, but just something to suggest that it's growing out of the ground.
@obsidian:
An arcade styled map doesn't need to give a realistic feel to the level. Flowers also doesn't have to float in the air on stems, but can grow near the grass ground...