I've started on reworking DirectQ's external texture loader, meaning that the release will be delayed.
I'd come really close to not doing this at all, but in the end it feels like the right decision: as this will be the last major D3D9 release it deserves to be a higher quality release, and it will give me a cleaner codebase to move to D3D11 from.
I won't go into the reasons why the external texture loader turned out the way it did, other than to say that with hindsight it was a clearly misguided case of trying to be all things to all people (being most things to most people and not creating a mess while doing so is infinitely preferable).
There's been a lot of new code and changed code in this version (even aside from the texture loader) so I expect that I'm going to have to do a patch version or two as follow-on, but for the most part I now feel that it's on fundamentally solid ground in parts of the codebase that previously weren't.
The major remaining things that I'm unhappy about are my use of the D3D effects framework for managing shaders, and memory allocation for server-side entities.
The effects framework is worth covering first, because my earlier HLSL ports didn't even use it at all. I brought it in to make some aspects of dealing with shaders easier, but there was a tradeoff that began to bite some time back, which is in terms of mixing and matching vertex and pixel shaders. I can't just take this vertex shader, pair it with that pixel shader and draw something - I need to write an effect pair for it. That's only a coupla lines of code, but as requirements to more flexibly handle options build up, the number of such pairs begins to balloon out of control.
My D3D11 code doesn't use the effects framework at all and is much cleaner and more flexible as a result. Things like a proper r_showtris mode (which I can't currently do without adding 30-odd more effect pairs) would be easy to add there.
The effects framework also has some small overhead of it's own, resulting in a few percent performance dip.
In the end I'm making the decision to not rework that for this release, as I'll need to be revisiting and reworking my shaders anyway when I move to D3D11. That's a job I would have had to do twice if I had taken it on now. For something like video startup and the modes list it's different - that's isolated in a very specific part of the engine and can be beaten into shape while not affecting how e.g. MDLs are drawn. The shaders permeate the entire renderer, are used everywhere, and one change in the handling of them will upset everything. That's the kind of job that you really only want to be doing once.
Server-side entities is not that big a deal by comparison; it's just a code quality and cleanliness thing. I do have this fear that some day it's going to explode in my face, but it's passed some fairly brutal tests so far and has been doing well enough to not merit raising it above other priorities.
Tuesday, January 24, 2012
DirectQ Update - 24th January 2012 - Here be Textures
Posted by
mhquake
at
10:24 PM
Subscribe to:
Post Comments (Atom)
5 comments:
Hey man, I JUST now started using DirectQ and I have to say it's FANTASTIC. After trying dozens of source ports over the past few years I gotta say this one is the best by far. I've been using darkplaces but DirectQ is far better. To me, it's literally perfect. If I could make a port it would be like this. I just wanted to say thanks for taking your time to do this, makes people like me very happy :)
Now, the rub: I am experiencing some texture flickering in areas where a wall or platform will recede behind a wall or underneath the floor. I've seen this on other source ports as well on a few different systems.
Again, DQ is great. Thanks again!
Thank you.
Unfortunately the flickering you mention is a map bug. It's fairly well known, affects a lot of the id maps, and while there are some things you can do to reduce it, they don't really work consistently or robustly.
Haha, so after some reading about z-fighting I've found few tricks that help, one of which was posted by you in 2008. Before I embark on this adventure *cringes* you wouldn't already happen to have a cvar in place would you? Kinda like gl_zfix in quakespasm?
I may just have to bite the bullet and go fix all the maps...
I had a zfix but removed it because it made things worse. OK, it fixed the z-fighting, but it turns out that you can't do that without introducing other (more serious) problems.
One fix introduced minute cracks between walls and floors, which were really really noticeable when the lighting differences were high enough. It also broke gameplay because it could give away secret areas.
Another fix caused objects to disapear at a distance - like the buttons in the zombie alcoves at the end of e2m7. Everything looked OK until you started backing off - and it didn't even need to be too far - when the buttons would start to sink into the walls.
So ultimately I don't believe that there is a robust general-case engine-side fix for this at all. You just pick which tradeoff is the lesser evil, and right now z-fighting - for all that it looks ugly - causes fewer problems than the other things I tried.
I'd love to be proven wrong here, but so far all fixes proposed are a case of "tried it, didn't work".
Ugh. As much as I hate (HATE) z-fighting I'd have to agree with you. Although I would probably take small cracks over z-fighting, It's not an issue with the engine but with the map, therefore the problem should be addressed there.
It's ironic, for me personally, the love of the game drives me to attempt make it better, but in doing so I lgrow to hate it and then put it away for a year and half, then find it again an pick up where I left off on my "quest for perfection". I guess now I just need to fix the maps and then...VICTORY!!!
Post a Comment