qbism / q2tools-220

Quake 2 map compiler tools with v220 map support, automatic phong, enhancements, and fixes.
GNU General Public License v2.0
61 stars 20 forks source link

Is there a way to -chop liquid? #41

Closed JafiMapping closed 10 months ago

JafiMapping commented 10 months ago

Because the triangles count is very heavy with liquid. Thank you

qbism commented 10 months ago

Cool idea. Similar to chop light. Wonder if anything is hardwired in game since vertices are moving. I will look at this next time in code. Do any other bsp tools implement this?

qbism commented 10 months ago

So liquids (SURF_WARP) faces are not chopped at all. The effect is done by the engine. `/*

SubdivideFace

Chop up faces that are larger than we want in the surface cache

/ void SubdivideFace(node_t node, face_t f) { vec_t mins, maxs; vec_t v; int32_t axis, i; texinfo_t tex; vec3_t temp; vec_t dist; winding_t w, frontw, *backw;

if (f->merged)
    return;

// special (non-surface cached) faces don't need subdivision
tex = &texinfo[f->texinfo];

if (tex->flags & (SURF_WARP | SURF_SKY)) {
    return;
}

`

JafiMapping commented 10 months ago

So it's already optimized if Surf_warp texture flag is checked? Il try to see de difference between each others.

Thank YOu!!

qbism commented 10 months ago

That is correct. BSP converts the whole map to triangles, but does not chop surf_warp smaller. Try gl_drawtris 1 in q2pro for example. quake001

JafiMapping commented 10 months ago

Thank you. That was my concern. I gl_showtris in KMQ2 (knightmare) and its -chop was not like you show in your picture at all. It had a huge amount of triangles. But despite of the huge amount of triangles, I think its optimized too, because when i ran it in Quake2 XP i didnt have a fps drop issue. Because, with that engine, when 3000 triangles are shown, this is what happen most of the time, at least, whit my not so bad cpu. :). The real time lightning is taking a lot of resources on that engine. Especially in combat scene.