q3map_surfacemodel to decal walls randomly
Started by Baker
avatar
Baker Rep. 1
#1   20 days ago
Member submitted image
I made some methods to use q3map_surfacemodel to automatically "decal" walls -- in addition to randomly placing bones or rocks or whatever. The bones are from OpenGameArt, the rocks from Sketchfab although I gave the rocks a real texture.
The "decals" are not decals but rather I made a one-side quad .OBJ model = 2 triangles.
Member submitted image
.obj and shader sources and links to the free models page of origin ... www.moddb.com/mods/zircon-engine.
It's funny, initially I was going to edit the q3map2 compiler or -- I have .map pre-processor in my engine that can do many automated tasks -- then I created the quad model and tried it with q3map_surfacemodel and it worked.
As far as I know the model cannot be an .md3 because it has only one quad. Fun fact ... due to obj model orientation being different in Garux/NetRadiant Q3map than classic original q3map2 -- this is because Garux uses assimp library and so does TrenchBroom -- the model coordinates would need rotated 90 degrees to work.
(I use J.A.C.K. map editor and a different q3map2 fork that behaves like original q3map2 -- and I can't easily switch because Garux/NetRadiant q3map2 despises some of my .map sources).
Oh -- and assimpl library used in Garux/NetRadiant and TrenchBroom actually will reject at least some .md3 models converted in .obj to .md3 by Noesis so it seems that .md3 is not a 100% compatibility magic bullet.)
avatar
Baker Rep. 1
#2   20 days ago
Member submitted image
I created that chest in BSP using "carve", haha!
The top is func_door. The beams are the old Q3 lightbeam quad trick on a patch.
Edited 2.62 minutes after the original posting.
avatar
Tig Rep. 2472
#3   19 days ago
@Baker : Lots of interesting things happening here.
Which version / branch of q3map2 are you using exactly? Is there a GitHub source?
avatar
Baker Rep. 1
#4   19 days ago
Hey Tig, I use
github.com/id-tech...ls/map-compiler
but I modified it some because it didn't work with J.A.C.K. and map version 220 out of the box, but that was the main change. I call this q3map2 "IsRyven/q3map2".
The exact one I use is www.moddb.com/mods...ly-6-odds-scale (source included).
I wanted to try to switch to the Garux map compiler (KleskBY the author of QUALKER uses it and so does Hypernoire, so we would all be using the same map compiler) , but there were close to 10 different compile issues for a very edgy map I made that compiles fine with "IsRyven/q3map2". Stuff like a triangle or surface triangle here or there or an MD3 it doesn't like.
Edited 1.37 minutes after the original posting.
avatar
Baker Rep. 1
#5   4 days ago
Member submitted image
10 to 1 that leileilol knows what player model that is, haha!
Edited 1 minutes after the original posting.
avatar
Hipshot Rep. 336
#6   3 days ago
My issue with surfacemodel back before was that I got so strange randomized results, artifacts I didn't want, like some thing sticking into another, or even worse clipping into another brush or face, so I more or less stopped using it.
However, with time I have gotten a lot better results, because I have applied the effects in a different way. Your things here looks very solid I have to say, but it's dark, so I can't really spot any clear errors either.
avatar
Baker Rep. 1
#7   3 days ago
Hipshot, here is the shader. I get no z-fighting that I have seen. Notice in the surface model OBJ file I have a Z (up and down) of 0.125 (==>v -8.000000 -8.000000 0.125). That keeps it from z fighting. The .obj works with classic q3map2 -- it will not work with Garux/NetRadiant compiler because that uses a different orientation. (The .obj would need rotated.)

textures/decals_sh/bricks_0019_wallmarks12
{
// modelpath density odds minscale maxscale minangle maxangle oriented
// DEN ODDS MINSC MAXSC MINANG MAXANG ORIENTED TO SURFACE Y/N
q3map_surfaceModel textures/zz_decals/wallmark1_surfacemodel.obj 200 3 0.25 2 0 360 1
q3map_surfaceModel textures/zz_decals/wallmark2_surfacemodel.obj 200 3 0.25 2 0 360 1
{
map textures/texturecan/bricks_0019_nogloss.tga
}
{
map $lightmap
blendFunc filter
rgbGen identity
}
} // decals_sh/bricks_0019_wallmarks12
// Baker: at this point amounts to a surface imperfection.
textures/decals_sh/wallmark1
{
polygonOffset
noPicMip
surfaceparm trans
surfaceparm nonsolid
{
map textures/zz_decals/wallmark1.tga
blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR // multiplicative
rgbGen vertex
}
} // textures/decals_sh/wallmark1

And here is the surfacemodel:

# Noesis .obj export. textures/zz_decals/wallmark1_surfacemodel.obj ...
#
mtllib unused.mtl
g
v -8.000000 -8.000000 0.125
v 8.000000 -8.000000 0.125
v 8.000000 8.000000 0.125
v -8.000000 8.000000 0.125

vt 1.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt 0.000000 1.000000 0.000000
vt 1.000000 1.000000 0.000000

vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000

g rdmobj00
usemtl textures/decals_sh/wallmark1
f 1/1/1 2/2/2 3/3/3
f 4/4/4 1/1/1 3/3/3

g

Edited 2.9 hours after the original posting.

Only registered members can post a reply.
Already registered? Sign in.

uozq3ta3
Clear