map models and light

Ask questions about mapping in general, and show off your in-progress work.
User avatar
PadPlayer
Posts: 3
Joined: Wed Jan 29, 2014 2:29 pm UTC
Location: Germany

map models and light

Postby PadPlayer » Tue Dec 01, 2015 1:26 pm UTC

Hi Guys,
when i make .ase-models out of brushes created with NetRadiant, put them in a map and compile it, the textures on the models look all matt and flat whereas others are shown correctly. Additionally light emitting textures used in the models don't make any light. It seems that q3map2 is just picking a bitmap instead of a texture with shader while converting the "model.map" to "model.ase". So i took a look in the ase-file and found something like this:

Code: Select all

*MATERIAL   9   {
      *MATERIAL_NAME   "textures/shared_ex/light1_orange_3000"
      *MATERIAL_CLASS   "Standard"
      *MATERIAL_DIFFUSE   1.000000   0.729000   0.376000
      *MATERIAL_SHADING Phong
      *MAP_DIFFUSE   {
         *MAP_NAME   "textures/shared_ex/light1_orange_3000"
         *MAP_CLASS   "Bitmap"
         *MAP_SUBNO   1
         *MAP_AMOUNT   1.0
         *MAP_TYPE   Screen
         *BITMAP   "..\textures\shared_ex_src\light1_p.jpg"
         *BITMAP_FILTER   Pyramidal
      }
   }

and changed it to:

Code: Select all

*MATERIAL   9   {
      *MATERIAL_NAME   "textures/shared_ex/light1_orange_3000"
      *MATERIAL_CLASS   "Standard"
      *MATERIAL_DIFFUSE   1.000000   0.729000   0.376000
      *MATERIAL_SHADING Phong
      *MAP_DIFFUSE   {
         *MAP_NAME   "textures/shared_ex/light1_orange_3000"
         *MAP_CLASS   "Bitmap"
         *MAP_SUBNO   1
         *MAP_AMOUNT   1.0
         *MAP_TYPE   Screen
         *BITMAP   "..\textures\shared_ex\light1_orange_3000.jpg"
         *BITMAP_FILTER   Pyramidal
      }
   }

Now the model at least emits light, but still looks quake3-like flat. Is there anything i could do to let them look like the rest of the map, or should i use another model format?


______________________________________
convert map to ase:

Code: Select all

[q3map2] -v -game tremulous -fs_basepath ~/.unvanquished -fs_game pkg -threads 4 -meta -custinfoparms -keeplights model.map
[q3map2] -v -game tremulous -fs_basepath ~/.unvanquished -fs_game pkg -convert -format -ase model.bsp

map compile:

Code: Select all

[q3map2] -v -game tremulous -fs_basepath ~/.unvanquished -fs_game pkg -threads 4 -meta -custinfoparms -samplesize 32 [map]
[q3map2] -v -game tremulous -fs_basepath ~/.unvanquished -fs_game pkg -threads 4 -vis -saveprt [map]
[q3map2] -v -game tremulous -fs_basepath ~/.unvanquished -fs_game pkg -threads 4 -light -fast -shade -dirty -patchshadows -samples 2 -samplesize 32 -bouncegrid -bounce 1 -deluxe -lightmapsize 1024 -external [map]
User avatar
Viech
Project Head
Posts: 2132
Joined: Fri Aug 03, 2012 11:50 pm UTC
Location: Berlin

Re: map models and light

Postby Viech » Wed Dec 02, 2015 2:00 pm UTC

I don't know the ASE format but I could imagine that, since it has its own "shader" format where stuff like a diffuse map is specified (as opposed to just a shader name understood by the game engine), it may not offer all the features that the BSP format together with its external files (lightmaps) offers. It may also be that not all of ASE's existing features are supported by q3map2. In particular, normal and specular mapping uses deluxe maps generated as external textures by q3map2. As far as I know not even the BSP format supports them internally.

With regards to other model formats, the future clearly is IQM. However, I do not know if there is support for IQM map models 1) in the game engine 2) in q3map2 or 3) in any map editor at this point in time… In any case you should refrain from using MD3 if they are not baked into the BSP properly as engine support will need to be dropped eventually. Similiarly, we may or may not continue to support MD5 but our focus will be on IQM.
Responsible for: Arch Linux package & torrent distribution, Parpax (map), Chameleon (map texture editor), Sloth (material file generator), gameplay design & programming, artistic direction
User avatar
Ingar
Mapper
Posts: 36
Joined: Thu Mar 22, 2012 3:09 pm UTC
Location: Belgium
Contact:

Re: map models and light

Postby Ingar » Sat Dec 05, 2015 2:07 pm UTC

As far as I know. q3map 2 ignores material settings on any model (OBJ, ASE, ..). The materials your model references should be defined in the Unvanquished shader files.

Use the OBJ format instead of ASE if possible, OBJ has more support in 3rd party 3D tools. Both ASE and OBJ are text file formats, so you can open edit them in notepad if necessary.

Here is an example from my map vega:

The ASE file models/mapobjects/vega/ceilinglight/ceilinglight1.ase contains
*MATERIAL 0 {
*MATERIAL_NAME "models/mapobjects/vega/ceilinglight/ceilinglight1"
... more stuff ...
*MAP_DIFFUSE {
*MAP_NAME "models/mapobjects/vega/ceilinglight/ceilinglight1"
... more stuff ...
*BITMAP "models/mapobjects/vega/ceilinglight/ceilinglight1.tga"


I'm not sure if q3map2 uses MATERIAL_NAME, MAP_NAME or BITMAP so I just set
all of them to the approriate shader name.

scripts/vega_models.shader contains the following:

models/mapobjects/vega/ceilinglight/ceilinglight1
{
qer_editorimage models/mapobjects/vega/ceilinglight/ceilinglight1_p

diffuseMap models/mapobjects/vega/ceilinglight/ceilinglight1_d
normalMap models/mapobjects/vega/ceilinglight/ceilinglight1_n
specularMap models/mapobjects/vega/ceilinglight/ceilinglight1_s
glowMap models/mapobjects/vega/ceilinglight/ceilinglight1_a
}


The OBJ file models/vega/table/table01.obj contains the following:

mtllib table01.mtl


Your 3D editor probably generated a .mtl file which contains the material definitions
for the OBJ file. This is ignored by q3map2.

In the OBJ file, a mesh can start with a usemtl directive. The example ceilinglight
contains the following:

usemtl textures/shared_vega/base03a


This means the mesh defined below it will be render using the textures/shared_vega/base03a
shader, as defined in scripts/shared_vega.shader[/i].

Things to keep in mind:

- As Viech already mentioned, the ASE and OBJ models are baked into the BSP by q3map2. This means that,
to the game engine, there's no difference between brushwork or ASE or OBJ models.
- MD3, MD5 and IQM models are read by the game engine itself.
- By default, models are noclip. Set the CLIPMODELS flag on the misc_model entity to enable auto-clipping. If your
model has complicated geometry, it might be better to manually add clip brushes.
- By default, models will be rendered fullbright. Set the FORCEMETA flag on the misc_model entity to enable
lightmap lighting.
User avatar
PadPlayer
Posts: 3
Joined: Wed Jan 29, 2014 2:29 pm UTC
Location: Germany

Re: map models and light

Postby PadPlayer » Tue Dec 08, 2015 6:59 pm UTC

Found the problem:
I used ".jpg" instead of ".tga" for the *BITMAP in my ASE model.
Leaving out the extension might work either while ".jpg" does not.

The main reason why I want to have some brushes in models is that q3map2 seems to have some problems with many small brushes. It is messing up some random triangles by putting single vertices somewhere far away. So i'm fine with the models in the BSP as long as q3map2 can handle them properly - and now it does. :thumbup:

Thanks! :smile: :ckit:

Return to “Level Design”

Who is online

Users browsing this forum: No registered users and 1 guest