Decals

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Decals

Post by Eraser »

Ok, bit of a newbie question, but what does a decal shader and texture look like again? I want to create a set of decals I can place in my map on existing surfaces to break up the monotony of a large textured face a bit. You know, stuff like stains and blood spatters and such.
cityy
Posts: 1020
Joined: Mon Aug 10, 2009 8:23 am

Re: Decals

Post by cityy »

www.ferdinandlist.de/leveldesign
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Decals

Post by Eraser »

That is awesome bro. Thanks a lot!
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Decals

Post by obsidian »

[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Decals

Post by Eraser »

Just a tip for those wishing to use the decals in cityy's ZIP file. The decal shaders in there will causes your brushes to cast shadows. Just add "surfaceparm trans" to fix that. Also, obsidian suggested adding q3map_bounceScale 0 to prevent the brush from reflecting radiosity light:

Code: Select all

textures/_MAP_/tab_decal_stain_a
{
   noPicMip
   polygonOffset
   surfaceparm nonsolid
   surfaceparm nomarks
   surfaceparm trans
   q3map_bounceScale 0
   {
      map textures/_MAP_/tab_decal_stain_a.tga
      blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
   }
}
There's also some great decal textures over at cgtextures. Note that you'll have to invert the colors and add a black background before you can use them with the supplied shaders though.
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Decals

Post by CZghost »

Wow, thanks for the decal textures, maybe I'll use it in my next map for MavComp#4...
EDIT: If I use the _decal projection, the range is from _decal patch and info_null entity but as the _decal patch is large or small, the decal will be also projected only in this size or the patch size is unimportant?
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Decals

Post by CZghost »

Tried the _decal projection in my EP testing map for tagret_gravity, doesn't work... I've captured few screenshots from a game and two from editor, how it looks like.

Editor screenshots:
Image
Image

In-game screenshots:
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_01.jpg[/lvlshot]
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_02.jpg[/lvlshot]
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_03.jpg[/lvlshot]
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_04.jpg[/lvlshot]
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_05.jpg[/lvlshot]
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_06.jpg[/lvlshot]
[lvlshot]http://dl.dropbox.com/u/76484093/Quake%203/Quake%203%20World%20screenshots/issues/ep_gravitytest/decals_07.jpg[/lvlshot]

In the robotrenegade page is written:
Make a simple patch mesh (it can be bent, but the quads in Radiant must be rectangular), select it and use the right-click context menu to turn it into a _decal entity. Target an info_null below the _decal entity and compile. Everything between the decal patch and the info_null will have a decal projected onto it.
Dou you can to specify what axis should be in use and how is calculated the distance?
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Decals

Post by obsidian »

If it's just a flat wall, just paste a normal decal patch on it and be done with it.

Decal entities are only if you want to project a decal onto complicated/multiple geometry that would normally be restrictive with a single patch. You have the entire entity/target facing the wrong way, the patch can "float" anywhere it and it targets an info_null that should be placed behind the surface you want it to project onto. The texture will be projected on everything between the patch and the info_null.

There is no distance value, it will literally project on every surface between the patch and target. You specify axis by moving the target/rotating the patch.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Decals

Post by Eraser »

Is there some benefit to using a patch instead of a nodraw brush that has one face textured with the decal shader?
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Decals

Post by obsidian »

No, that will work too. Patch is maybe easier to move around, identify and filter as a decal.

Some textures (like the blood streaks used in Doom 3) are easier to stretch and bend as a patch.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Theftbot
Posts: 483
Joined: Thu Oct 08, 2009 4:03 am

Re: Decals

Post by Theftbot »

Dont forget to make brush detail if you do
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Decals

Post by CZghost »

So I've done it wrong. the target_null may be behind surface to project and distance doesn't matter...
If it's brush, it may be detail. Patches are detailed automaticaly?

I'll try it as I'll get home from school...
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Decals

Post by Eraser »

CZghost wrote:Patches are detailed automaticaly?
The short answer is yes.
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Decals

Post by CZghost »

Eraser wrote:
CZghost wrote:Patches are detailed automaticaly?
The short answer is yes.
And the long answer? Because when I've tried to add a detail keyword to the decal shaders, it was floating in air and displaing dummy texture. Then I've removed the detail keyword. Shaders now was displaing right textures, but again floating in air...

So I'm asking, what's wrong? The target_null is now behind the decals and the _decal before the decals... _decal patch have nodraw common texture, is it this wrong? Will the _decal entity display in game when use solid texture?

If it's possible, make me please screenshot from editor and from game with and without tris, how it may look like... I'm using Radiant 1.5

In the robotrenegade page are in-game screenshots, but not the radiant sceens... Does ydnar still develope the q3map2 and make maps?
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Decals

Post by Eraser »

- Create a brush.
- Place an info_null entity behind it.
- Place a patch in front of it and give this patch the decal shader you want.
- Turn the patch into a _decal entity
- Have the patch target the info_null entity.
- Compile.

As I understand it, that is what you need. The shader applied to the patch will be projected on the brush between the patch and the info_null entity.

I'm not sure what the difference is between the "detail" surfaceparm and the "trans" surfaceparm. The shader manual says basically the same thing about both of them. I don't think you ever need to use the "detail" surfaceparm as you can make brushes detail in the editor (hit CTRL+M when having a brush selected). I know that the "trans" surfaceparm stops the surface from blocking light, so maybe it does both or perhaps it has no effect on VIS and the shader manual is wrong. Someone should test this.

But I digress. What you need to do is follow the steps I put at the beginning of this post and forget about detail brushes because patches have no effect on the VIS stage of compiling your map so in that sense, patches are similar to detail brushes.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Decals

Post by obsidian »

[lvlshot]http://zero.robotrenegade.com/imgdump/decalentity.jpg[/lvlshot]
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Decals

Post by CZghost »

Very thx, it's functionable now... I'll sketch the _decal usage ;)
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
Post Reply