There are currently 52 players online.
 
Warsow


 
 

backAdventures in engine land, part 2

Forum index
Blog
Adventures in engine land, part 2
Posted by
Post Scroll to bottom
Vic

Member
(4891 posts)

Welcome back to the second installation of engine adventures! This time I'll talk about the changes I've introduced to the model rendering in the next version of the game. If you don't like technical details, you may just skip to the end of this blog post :)

The first major change is that we've switched the model format we use for skeletal animation: SKM/SKP is gone, IQM is in. The reasons are quite simple: SKM isn't used anywhere outside Warsow, it's an obscure and barely supported tools and exporters wise format. IQM aims to be the universally accepted format for all relevant Quake-based engines so the chances it's not going to become obsolete in the near future are higher than those for SKM. By the way, the SKM/SKM to IQE exporter was part of the 0.62 release..

One thing I noticed while speccing bomb matches in 0.6x is that framerates dropped considerably with several player models in sight. Clearly something had to be done about that. Two things came to mind: performing skeletal animation on GPU and avoiding multipass shaders for our player skins. Moreover, both approaches required GLSL programming, could be implemented independently and would complement each other nicely.

Non GLSL path could also be optimized using an approach called matrix palette skinning, which is done on CPU. It allows performing only one matrix multiplication per vertex, irregardless of the number of affecting bones. In case you didn't know, each vertex in a skeletal model has 1 or more influencing bones attached to it. Both SKM and IQM pose a limit of influencing bones at 4. Each influence is basically a matrix and a influencing factor (weight), ranging from 0 to 1. Skeletal animation basically boils done to transforming these matrices and then applying the result to vertices. In short, matrix palette skinning allows combining these influencing matrices beforehand and not transforming the vertex by each influence individually, saving the CPU power.

For the GPU skinning dual quaternions technique could be used. eihrul (the author and maintainer of the IQM format) helped me enormously to implement both approaches, patiently answering my questions on the IRC and providing me with clues and code. Thank you, Lee!

Perhaps the least mathematically intriguing part of my optimizations and the most torturing one was writing a specialized GLSL shader that would allow to render all of our player models in a single pass, no matter what skin. That required painstakingly analyzing, grouping and templating of all of the shaders we use for player skins and then writing and debugging the aforementioned GLSL program, which wasn't a terribly exciting experience, but I won't go into further details on that.

All the changes I described here took a couple of months of on and off work to implement and debug.

Now what's the outcome in terms of framerates a reader might ask? Here are screenshots of 0.62 and 0.7 running the same scene with 20 animated bigvic models with default skins (fps counter is in the upper right corner).

Note that both screenshots were taken with model outlines enabled, so that doubled the number of models actually rendered.

clownfart

aka simon
(1024 posts)

Awesome work. Looks like the default hud AR was updated in .7 too. :D

KILLME

Member
(1508 posts)

Cool post, very good read. Keep it up :D

DalaiLamer

All your base are belong to us.
(462 posts)

Vic

Member
(4891 posts)

Koochi

Member
(935 posts)

ninja coder !! amazing work

crizis

Mad Hatter
(4078 posts)

i'm in ur engine, stealing ur fame

KeRpaL

Member
(715 posts)

Falconer

Member
(944 posts)

m0t0

Member
(842 posts)

yeah this goes way beyond my understanding but really really awsome job!

VectorVanDoom
(updated Today 13:37)
(1991 posts)

u mixed up the links to the screenshots or are you telling us that 0.62 has better fps?

toukkapoukka

Has-been developer
(282 posts)

0.62: 88fps, 0.7: 157fps looks correct to me :)

idontcare

Member
(205 posts)

remedy

Member
(55 posts)

great work. i've noticed fps drops when 6-8 players are on screen (esp. without fullbright), hope this will be gone.

crizis

Mad Hatter
(4078 posts)

Just to add, with playermodel outlines off, it's +100~ fps.

Darkwave
Member
(216 posts)

gj Vic! You programming beast! Keep it up!

SolidFake

Member
(4388 posts)

nice one vic
the switch of the model type to iqm was imo very wise, alot of players never heard or skm before ^^

adem

Группа ВКонтакте vk.com/wsw_ru
(1298 posts)

i'va heard of skm before!) i'm the winner!

thanks vic for explaining your work. really informative and interesting post.

learn_more

Member
(3316 posts)

jal

master of the universe
(10599 posts)

The models shading seems slightly different. What's the difference?

P.S: Yes Solidfake, because all players haver heard of IQM before.


Scroll to top



RSSRSSRSSRSS

Copyright © 2013 Chasseur De Bots

Warsow in social media



Warsow is an indie game developed by group of hobbyists. Please consider giving us a small donation: