Decals not showing up in game


(FBIagent) #1

Hello,

i have a problem with decals using the _decal entity. I created a brush and applied a decal shader to
it. After that i made a simple patch mesh out of it with Shift+P. After doing a right click to make it a
_decal entity i created an info_null entity which is targeted by the _decal entity.

My problem is the decal does not show up in game.

The screenshots in the attachment shows the place of the decal, one time with the wall near it
deleted where it shows up. But with the wall it does not appear. The maps.zip contains two maps.
The one of the screenshots and another small decal test where the decal is shown with a similar
wall structure.

I tried many things, moving the patch around in a place where it’s not near a wall etc.

Would be nice if somebody could show me what’s wrong.


(DeatH) #2

Have you tried making the decal with a brush rather than a patch?


(FBIagent) #3

I tried making a simple brush with all faces expect the top one having common/nodraw.
I placed it exactly on the floor and that worked. It flickers in the GtkRadiant but not in game.

Should i use that kind of decals when i can instead of the _decal entity system?

But it would be still interesting why the decal is not shown.


(DeatH) #4

[QUOTE=FBIagent;341568]I tried making a simple brush with all faces expect the top one having common/nodraw.
I placed it exactly on the floor and that worked. It flickers in the GtkRadiant but not in game.

Should i use that kind of decals when i can instead of the _decal entity system?

But it would be still interesting why the decal is not shown.[/QUOTE]

If you want the light to flicker you can do this without using the _decal.

You can set the Key and values of the light above the brush to make it appear to flicker, but I have forgotten myself how to do this.

Try this
http://www.splashdamage.com/forums/showthread.php?t=16084&highlight=light+flicker


(Avoc) #5

I dont think he wants the light to flicker, he just wants the brush to show up, right?

What you need to do, is to make a new shader. You can simply copy the existing shader from the lights.shader (or whatever its called) and paste it into your own shader file (remember to place it into the shaderlist.txt or you wont be able to see it).

At the top, you need to add ‘polygonOffset’ - your shader will look something like this:


textures/yourfolder/light_decal
{
	qer_editorimage textures/lights/light_c01.tga
	q3map_lightimage textures/lightimage/light_c01_color.tga
	q3map_surfacelight 500
	
	polygonOffset
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm pointlight
	surfaceparm nomarks
	{
		map textures/lights/light_c01.tga
		rgbGen vertex
	}
	{
		map textures/lights/light_c01.blend.tga
		blendfunc GL_ONE GL_ONE
		rgbGen identity
	}
}

The easiest way to explain ‘polygonOffset’ is that, it makes your texture always appear at the top of texture that does not have the ‘polygonOffset’ in their shader. However, you can’t use two polygonOffset textures on eachother, as they will also either flicker, or one of them simply won’t appear.

You do not need to use the _decal entity in order to make this work. Just apply it to a brush. Just make sure you don’t apply all sides of the brush with the same texture, as it might create some funky lighting effects in your map.


(Mateos) #6

By using this shader, if I place a patch mesh on the exact place of a brush, while in Gtk it will tilt, ingame it will looks fine, like the Tank road on FuelDump for exemple?


(stealth6) #7

yes :stroggtapir::stroggtapir:


(Mateos) #8

Awesome. Will use it tonight :slight_smile:


(stealth6) #9

Well there is 1 bug with polygonoffset, if you are standing right in front of the texture (90 degree angle)
then you can still get the flickering effect, but since this rarely happens most people never notice it.


(Mateos) #10

If it has to be the perfect 90° angle on all axes X/Y/Z, will hardly happen on a non-flat map, or if it is used on walls?

Should be fixed in OpenWolf/ETXReal :stuck_out_tongue:


(FBIagent) #11

[quote=Avoc;341941]I dont think he wants the light to flicker, he just wants the brush to show up, right?

What you need to do, is to make a new shader. You can simply copy the existing shader from the lights.shader (or whatever its called) and paste it into your own shader file (remember to place it into the shaderlist.txt or you wont be able to see it).

At the top, you need to add ‘polygonOffset’ - your shader will look something like this:


textures/yourfolder/light_decal
{
    qer_editorimage textures/lights/light_c01.tga
    q3map_lightimage textures/lightimage/light_c01_color.tga
    q3map_surfacelight 500
    
    polygonOffset
    surfaceparm trans
    surfaceparm nonsolid
    surfaceparm pointlight
    surfaceparm nomarks
    {
        map textures/lights/light_c01.tga
        rgbGen vertex
    }
    {
        map textures/lights/light_c01.blend.tga
        blendfunc GL_ONE GL_ONE
        rgbGen identity
    }
}

The easiest way to explain ‘polygonOffset’ is that, it makes your texture always appear at the top of texture that does not have the ‘polygonOffset’ in their shader. However, you can’t use two polygonOffset textures on eachother, as they will also either flicker, or one of them simply won’t appear.

You do not need to use the _decal entity in order to make this work. Just apply it to a brush. Just make sure you don’t apply all sides of the brush with the same texture, as it might create some funky lighting effects in your map.[/quote]

As you can see i already used the light decal shader and also my own decal shader was working fine with a
simple brush. It also worked with the _decal entity, but only when that one wall on the screenshot where the
decal is shown is deleted. If that wall is present the decal is not drawn on the floor.

With a simple brush where only the top gets a texture seems to always work on my floor, no matter if the wall
is present or deleted.

So the question is still open:
Why is the decal not shown when the wall is present(using _decal entity with patch targeting a info_null
entity)?

The answere is very important, because i may replace the flat floor with an uneven terrain where an usual
brush can’t be placed exactly on the floor, there i need to use the _decal entity system.

That is my custom decal shader. But i don’t think the shader is the problem, because the standard light decal
shader i used to test has the same effect.


textures/l2_giran/sd_floordecal01
{
	qer_editorimage textures/l2_giran/...

        // for _decal entry decals prevents Z-fighting
	polygonOffset
        // for _decal entity decal, if problems with depth sorting occours
	sort 6

        // we want that decal to be like the floor itself, apply the lightmap on it
	{
		map $lightmap
		rgbGen identity
	}
        // the decal texture, blend it over the lightmap(50%/50%)
	{
		map textures/l2_giran/...
		blendFunc GL_DST_COLOR GL_ZERO
	}
}


(Avoc) #12

Thats a question I cannot answer. I’ve never used the decal entity, and as far as I know, none of the original maps made by SD use the decal entity either.
In fact, if you take a look at fueldump.map, you’ll see a lot of textures that usually should be decals, are in fact just shaders with ‘polygonOffset’ in them. This is especially visible under every tree in the map.