LOD issue

UGLYdumpling

L3: Member
May 24, 2010
127
56
ok, i've done this before - but somehow it's not working for me now.
Maybe I've been staring at it for too long.

When i do a regular compile using the 'low' mesh as a LOD @50 ... I test in the model viewer and at 50 it displays nothing and the info panel says there is no geometry displayed. It's not flipped normals, it is replacing my highrez mesh with 'nothing'. hmph!

So the meshes load independently - if I create a temporary .QC for the lowrez LOD.
*IGNORE THE TEXTURES plz, they are temporary* :cool:
lodissue.jpg


Here's the .QC for the highrez mesh

Code:
/*
----------------
UGLYivy QC
Model by : UGLYdumpling (sammy@hallam.ca)
Texture by : BoyLee (mattboyle84@googlemail.com)
----------------
*/

$modelname "custom_models\uglyivy\uglyivy01.mdl"

$origin 0 0 0 90
$scale 1.0
$body "Body" "uglyivy01.smd"
$staticprop
$surfaceprop wood
$upaxis Z

$cdmaterials "custom_models\uglyivy"

$sequence "idle" "uglyivy01.smd" fps 30

// LOD 1
$lod 50
{
       replacemodel "uglyivy01" "uglyivy01low"
}

and the buffer for my compile ...

> Executing: C:\Program Files (x86)\ConTEXT\ConExec.exe "C:\Program Files (x86)\Steam\steamapps\inflictforce\sourcesdk\bin\orangebox\bin\studiomdl.exe" "C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models\custom_models\uglyivy\uglyivy01.qc"

WARNING: AppFramework : Unable to load module p4lib.dll!
qdir: "c:\program files (x86)\steam\steamapps\inflictforce\team fortress 2\tf\models\custom_models\uglyivy\"
gamedir: "C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\"
g_path: "C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models\custom_models\uglyivy\uglyivy01.qc"
Building binary model files...
Working on "uglyivy01.qc"
SMD MODEL uglyivy01.smd
SMD MODEL uglyivy01low.smd
---------------------
writing C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models/custom_models\uglyivy\uglyivy01.mdl:
bones 964 bytes (1)
animations 112 bytes (1 anims) (1 frames) [0:00]
sequences 220 bytes (1 seq)
ik/pose 164 bytes
eyeballs 0 bytes (0 eyeballs)
flexes 0 bytes (0 flexes)
textures 268 bytes
keyvalues 0 bytes
bone transforms 0 bytes
collision 0 bytes
total 2096
---------------------
writing C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models/custom_models\uglyivy\uglyivy01.vvd:
vertices 190656 bytes (3972 vertices)
tangents 63552 bytes (3972 vertices)
total 254272 bytes
---------------------
Generating optimized mesh "C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models/custom_models\uglyivy\uglyivy01.sw.vtx":
body parts: 8 bytes
models: 32 bytes
model LODs: 24 bytes
meshes: 36 bytes
strip groups: 50 bytes
strips: 54 bytes
verts: 35748 bytes
indices: 18324 bytes
bone changes: 32 bytes
everything: 54320 bytes
---------------------
Generating optimized mesh "C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models/custom_models\uglyivy\uglyivy01.dx80.vtx":
body parts: 8 bytes
models: 32 bytes
model LODs: 24 bytes
meshes: 36 bytes
strip groups: 50 bytes
strips: 54 bytes
verts: 35748 bytes
indices: 18324 bytes
bone changes: 32 bytes
everything: 54320 bytes
---------------------
Generating optimized mesh "C:\Program Files (x86)\Steam\steamapps\inflictforce\team fortress 2\tf\models/custom_models\uglyivy\uglyivy01.dx90.vtx":
body parts: 8 bytes
models: 32 bytes
model LODs: 24 bytes
meshes: 36 bytes
strip groups: 50 bytes
strips: 54 bytes
verts: 35748 bytes
indices: 18324 bytes
bone changes: 32 bytes
everything: 54320 bytes

Completed "uglyivy01.qc"
> Execution finished.
 
Last edited:

Acumen

Annoyer
aa
Jun 11, 2009
704
628
maybe add the ".smd" at the end of your lod replacement ?

mine looks like this:

$lod 30
{
replacemodel "ref_tractor.smd" "lod1_tractor.smd"
}
 

Acumen

Annoyer
aa
Jun 11, 2009
704
628
maybe post the model's qc where it 100% worked ?
make sure you recompiled and doublechecked that "old" model where you had no problems with LOD.
 

UGLYdumpling

L3: Member
May 24, 2010
127
56
hmmm ... the 'low' is nothing fancy at all.
two polygon planes with simple textures I hardware rendered.

wierd, eh?

Code:
/*
----------------
UGLYivy QC
Model by : UGLYdumpling (sammy@hallam.ca)
Texture by : BoyLee (mattboyle84@googlemail.com)
----------------
*/

$modelname "custom_models\uglyivy\uglyivy01low.mdl"

$origin 0 0 0 90
$scale 1.0
$body "Body" "uglyivy01low.smd"
$staticprop
$surfaceprop wood
$upaxis Z

$cdmaterials "custom_models\uglyivy"

$sequence "idle" "uglyivy01low.smd" fps 30
 
Last edited:

Acumen

Annoyer
aa
Jun 11, 2009
704
628
i meant with the LOD working. sounded like you the lod stuff working once before on a different model...

exporting issue couldn't be the problem since it worked as an individual compile, i guess...
end could be uploading and let others do a testcompile to check it all out :/
 

UGLYdumpling

L3: Member
May 24, 2010
127
56
oh! well the working LOD that i've done before is my steamroller.

Code:
/*
----------------
Steamroller QC
Model by : UGLYdumpling (sammy@hallam.ca)
Texture by : BoyLee (mattboyle84@googlemail.com)
----------------
*/

$modelname "custom_models\steamroller\steamroller.mdl"

$origin 0 0 0 90
$scale 1.0
$body "Body" "steamroller.smd"
$texturegroup skinfamilies
{
	{ "steamroller"  }
	{ "steamroller_red" }
        { "steamroller_blu" }
        }

$staticprop
$surfaceprop metal
$upaxis Z

$cdmaterials "custom_models\steamroller"

$sequence "idle" "steamroller.smd" fps 30
$collisionmodel "steamroller_c.smd"
{ $mass 100.00
  $concave
  }

// LOD 1
$lod 50
{
      replacemodel "steamroller" "steamroller_lo"
      }
 

UGLYdumpling

L3: Member
May 24, 2010
127
56
gave my files to acumen. We spent nearly an hour trying all sorts of things like re-exporting the geometry - swapping the highrez for lowrez in the replacemodel section ... no results.

Never tell your password to anyone.
Tuesday, August 10, 2010
3:58 PM - UGLYdumpling: hey dude, when you have a minute, i'll take you up on your offer to check out my files ...
3:58 PM - UGLYdumpling: http://dl.dropbox.com/u/9497546/uglyivy01.rar
3:58 PM - Acumen: thanks
3:59 PM - UGLYdumpling: no, thankYOU :cool:
3:59 PM - Acumen stops saving the world and starts checking
4:00 PM - UGLYdumpling: it's quite peculiar, i took a break and took another look - i'll be damned if it don't look perfect to me ... meh
4:00 PM - Acumen: haha you know whats best
4:00 PM - Acumen: the different folder structure
4:00 PM - Acumen: thats so annoying about that valve way of doing things
4:01 PM - UGLYdumpling: tf/materials/custom_props ... etc?
4:01 PM - Acumen: nah
4:01 PM - Acumen: everyone doing things differently :D
4:01 PM - Acumen: first i gotta hack your stuff to my stuff :D
4:01 PM - Acumen: gimme a sec
4:05 PM - Acumen: k
4:05 PM - Acumen: first compile shows the same
4:05 PM - Acumen: just disappears
4:05 PM - Acumen: the model is a simple plane
4:05 PM - Acumen: is that right ?
4:05 PM - UGLYdumpling: odd that i find that news pleasing
4:05 PM - Acumen: the lod model, i mean
4:06 PM - UGLYdumpling: the LOD is two poly planes yeah -
4:06 PM - UGLYdumpling: i thought the normals were reversed or something silly, but i rotate the camera int he model viewer - don't see anything
4:06 PM - UGLYdumpling: the wireframe mode reveals nothing - the info panel says there's nothing there either ...
4:06 PM - Acumen: any reason why its double planed ?
4:07 PM - UGLYdumpling: one for the ivy, one for the leaves
4:07 PM - Acumen: ah k
4:07 PM - Acumen presses ctrl z
4:08 PM - UGLYdumpling: btw, if you compile the uglyivy01low.qc you'll see the result - so i know it can't be the smd cuz - well, the model viewer displays it like there's no problem
4:09 PM - Acumen: btw
4:09 PM - Acumen: there a reason why you use a giant texture but little space used on the Lo-textures ?
4:09 PM - UGLYdumpling: 8-/
4:09 PM - UGLYdumpling: cuz I work high and prune stuff down when i'm ready to release
4:09 PM - Acumen: ah :D
4:11 PM - UGLYdumpling: hmm, i just had a thought
4:11 PM - UGLYdumpling: i wonder ...
4:12 PM - UGLYdumpling: ... if the names of the vines geometry and leaves geometry before i export to SMD format have to be identical - they're not referred to directly, but it MAY play an invisible role when replacing for LOD
4:12 PM - UGLYdumpling: as it stands i believe the LOD model has a _LO tacked onto the geometry names
4:13 PM - Acumen: i jsutr tried reexporting the smds
4:13 PM - Acumen: with the textures newly applied
4:13 PM - Acumen: and an additional box applied
4:13 PM - Acumen: no change :&
4:13 PM - UGLYdumpling: grr
4:16 PM - Acumen: k
4:16 PM - Acumen: just for the fun
4:16 PM - Acumen: i used the normal smd as the lod replacement
4:16 PM - Acumen: then it works
4:16 PM - Acumen: so it got to be something with the smd
4:16 PM - UGLYdumpling: hmm, good point
4:16 PM - UGLYdumpling: that's a good lead - I'll see where it takes me, standby
4:19 PM - Acumen: 0 "uglyivy_01leaves_LOW" -1
1 "uglyivy_01vines_LOW" -1
4:19 PM - Acumen: that stands in the smd
4:20 PM - Acumen: yet all the names you choose have LO
4:20 PM - Acumen: missing W
4:20 PM - Acumen: that a clue leading anywhere ?
4:20 PM - UGLYdumpling: uhhm
4:22 PM - UGLYdumpling: yeah, that's the question i was asking earlier ... the geometry is named slightly different in maya/xsi between the HIREZ and LOWREZ ... however, LO and LOW are texture and geometry respectively so I wonder ...
4:22 PM - Acumen: tried and reassigned materials
4:22 PM - Acumen: no change
4:31 PM - Acumen: aaaah
4:31 PM - Acumen: kkkk
4:31 PM - Acumen: got some result
4:31 PM - Acumen: must have to be something with the use of bones
4:32 PM - UGLYdumpling: wtf, bones? hmm
4:32 PM - Acumen: just deleted both bone settings in the smds
4:32 PM - Acumen: and it worked
4:32 PM - Acumen: i just dont know how you apllied your textures :D
4:32 PM - Acumen: so i couldnt properly compile :D
4:32 PM - UGLYdumpling: well that means the issue is with XSI then
4:33 PM - UGLYdumpling: i have no direct way to export from Maya - don't get me started on that clusterfuck, i mean ffs - how hard is it to compile the smd export plugin for new versions of maya
4:33 PM - Acumen: aaaaah
4:33 PM - Acumen: its gone again
4:34 PM - Acumen: good lord what was that
4:34 PM - UGLYdumpling: hmm
4:35 PM - Acumen: i dont get it
4:35 PM - Acumen: what i did was
4:36 PM - Acumen: get both smds in max
4:36 PM - Acumen: apply only one texture of the LO
4:36 PM - Acumen: delete the bones
4:36 PM - Acumen: and then compiled
4:36 PM - Acumen: AND then it worked
4:36 PM - Acumen: in model viewer
4:36 PM - UGLYdumpling: some sort of data curruption/ghost in the machine
4:49 PM - UGLYdumpling: no results on this end...how utterly frustrating
4:49 PM - Acumen: me neither
4:49 PM - Acumen: what an utter thing :eek:
4:55 PM - Acumen: man thas weird
4:55 PM - Acumen: now i switched it around
4:55 PM - Acumen: so LO is detail model
4:55 PM - Acumen: and 01 is lod model
4:55 PM - Acumen: doesnt work either
4:55 PM - Acumen: only first model is shown
4:56 PM - UGLYdumpling: so switched around the hirez isn't showing but the lowrez is ?
4:56 PM - Acumen: yes
4:56 PM - UGLYdumpling: hmm
4:56 PM - Acumen: so theres gotta be something on the qc, dont you think ?
4:57 PM - UGLYdumpling: yeah, that's what logic would dictate
4:57 PM - Acumen: logic is a bitch
4:57 PM - UGLYdumpling: an unholy bitch, yes
4:57 PM - Acumen: weird thing is
4:57 PM - Acumen: when i compile it your way
4:57 PM - Acumen: the compile takes very long
4:58 PM - Acumen: when i compile the other way round
4:58 PM - Acumen: LO first
4:58 PM - Acumen: its superfast
4:58 PM - Acumen: as if the lod model gets switched within the compile...
4:58 PM - UGLYdumpling: one mind blowing thing at a time plz :cool:
5:04 PM - UGLYdumpling: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa! i surrender!
5:04 PM - Acumen: good lord im about to die
5:05 PM - UGLYdumpling: ok, i will relieve you of this burden m8 - thanks for giving it a good try ...
5:05 PM - Acumen: man that mystery needs to be solved
5:05 PM - UGLYdumpling: yes.
5:06 PM - UGLYdumpling: and don't go picking this up again - you could injure yourself, k?
5:06 PM - Acumen: we'll see :D
5:06 PM - Acumen: total maneuver tomorrow :D
5:17 PM - Acumen: maybe you could check the texture namings
5:17 PM - Acumen: the uppercase textures
5:17 PM - Acumen: and reapply textures with lowcase namings
5:17 PM - Acumen: but ah, that cant be true....
5:17 PM - Acumen: since it worked other way roudn....
Acumen is now Offline.

i think we both came about -> <- this close to losing our minds completely.
I will give you a Golden Wrench if you can solve the mystery!
http://dl.dropbox.com/u/9497546/uglyivy01.rar
 
Last edited:

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
The problem is because you're asking the model to use two separate texture sets through LODs as though they were different skins. This is incorrect. This is where your problem lies. Your smds for each LOD can use completely different UV meshes if you desire...the problem is that the model is still reading the first texture set for the LOD version...which is nonexistant, since you've told the LOD smd to change texture sets.

However, if you tell the LOD smd to use the same texture set as the full polygon ulgyvines01 version, you no longer have the problem. See below:

uglyivy_demo_01.jpg


Naturally, this is not a good solution because the UV coordinates are completely wrong as they were not intended to be used by this texture set. You can't have a model with LOD versions that use different texture sets. You can have a model with different skins and LODs, just not with different skins per LOD version...the LODs will always look for the parent textures of the full poly version.

But a MUCH better solution lies ahead of you, because there's already some problems with the texture and UV setup here, whether you intended it to be this way or not...

uglyivy_demo_02.jpg


So much wasted space, and on 1024 maps? That much will cause you performance issues faster than the 3000 polycount, which btw isn't really that bad.

I'd suggest getting it all onto 1 1024 map, even a 512 would be ok. You can still have multiple shaders on one texture map ("$alphatest" "1", this case, and as many others as you want), if you have questions as to how this is done, PM me, I'll explain the process in a per-software basis. As far as your LOD version, just use a program or plugin that will let you reduce the polycount and keep the UV intact. At a distance, and distortion in the LOD won't be noticable--that's the point of the LOD anyway. Make 2 or three of them, that way the change is gradual. Going from 3000 polys to 4...not a good idea.

Also, I'd leave all this fancy-pants stuff out of your QC...there's no one to impress! Being able to write a QC and compile a model is credit enough. Anyone smart enough to recompile your work is just going to delete it anyway, it doesn't serve as copy protection.

/*
----------------
Steamroller QC
Model by : UGLYdumpling (sammy@hallam.ca)
Texture by : BoyLee (mattboyle84@googlemail.com)
----------------
*/
 
Last edited:

Acumen

Annoyer
aa
Jun 11, 2009
704
628
thank god you still check the forums from time to time :)
 

UGLYdumpling

L3: Member
May 24, 2010
127
56
Eureka!

Seems obvious now, but I guess I just assumed that the swapping of models in the LOD process is just that - swapping A for B. I didn't realize there's a relationship between A and B at a UV level. I don't know enough to understand if that makes any sense, but I have to live with it.