Posted: Sun Dec 23, 2007 1:42 am Post subject: Development Diary (upcoming features of the patch)
At the moment, and as i said, i'm trying to reverse engineering the original shaders of the game.
I've been working on a special effect for the 'wave pools' (as i call them), and this is what i've done till now:
Left: Default effect, Center: With Reflection, Right: With Reflection & Refraction
The reflection effect has no performance hit, and it has been done using a custom pixel shader program that blends the surface of the blood with the reflection of the room.
The refraction effect deserves a deeper explanation.
I use perlin noise to generate the refraction map for the water. It's a gfx effect that needs a huge computing power, but the result is really outstanding ! (as you can see in the pics, and in games like HL2).
Perlin noise could be computed using GPU power, or CPU power. My decision here has been to use the CPU power. Why ? Cause the game is ultra high bounded by the GPU power, and we're on the multi-core era.
Therefore, i've developed a perlin noise algorithm that scales to a N number of cores (with N times performance scaling), and it's highly optimized using SSE3 (not intrinsics, pure assembler). I could have optimized it for SSE4 even, but, i've a SSE3 cpu atm only (I've like 15 years of experience at assembler coding). There's a non SSE3 algorithm too.
As result, this effect hasn't any performance hit for the dual core users (and above). Also, the quad core users will enjoy a smoother effect on their systems. It's not recommended for single core users.
I've developed a benchmark tool too, to measure the power of your CPU (highly recommended).
The effect works perfectly atm, and i'm working trying to enhance it even more.
I've been working on the same effect applied to the water:
Left: Refraction / Right: Default (but with the enhancements of the patch)
Water rendering is different from the 'blood pools'. It hasn't reflection.
I use the same perlin noise generator to create the water refraction. I think that i can apply this same sort of refraction effect to the 'blood fields' too. Or perhaps to the aura vision too. If you've any ideas, post them here.
I'm trying to add some sort of bump map effect too, but, it's hard, cause this sort of effect needs info about the direction & position of the camera, and i haven't it.
If you've a dual core or above, this effect won't have any performance hit for you. You'll have the same FPS with or without it. This is great, cause it's the perfect way to use the rest of your unused cores for something cool.
I've been checking the blood pools, and they've no normal info, so, i won't be able to apply any bump map effect to them (prolly). Also, the pixel shader program seems very complicated. I've been trying to write my own program, but, it ended drawing something very different from a blood pool.
Therefore, since all these new features have been in development for 3 months now, i've decided to release a new public version of the patch next weekend.
I'll keep trying to add more effects based on this new 'technology' (sounds great when you create it by your own), to enhance the blood pools (to make them more gore), and other effects.
Today i released a new version of the patch. It was mainly a quickfix, for a bug that i detected after the release of the last version of the patch, and to add some compatibility with Vista.
I should have been working on the new features of the patch, but, i'm concentrated on a new project called 'BloodRayne 2 HD'.
This new project will replace the old low resolution textures of the game, with new high resolution textures.
In this project, i just need artists who can redraw a low res texture, into a new high res texture.
Therefore, atm i'm 'drawing' new textures for the game instead of coding new features for it. Therefore, if you love the game, and if you want to see it as cool as it deserves, please, join to this new project, and give me more time to work as coder & not as an artist
Last, i need to say, that i posted my patch at the TR forums, and it was an error, cause the admins deleted my thread. Why ? They said that i hadn't 100 qualitative posts.
8/4/2008: I sent a pm to the TR forums site owner, and he restored the thread. We cleared the misunderstanding.
We plan to release some sort of demo, once we finish all the textures of the 1st act of the game.
We are rebuilding all the textures from zero (no upsampling methods used). The result in-game is awesome.
I have been working a little on the patch too, cause we had a problem with the engine of the game. The game uses a fixed size texture for Rayne's model (512x1024), and it crashes if you change this size. Luckily, i have found a way to use high resolution textures for Rayne too, and i have tested it with 2048x4096 textures. So, we'll be working on a new HD texture for Rayne too.
This new feature is very cool, cause, it also allows you to swap the Rayne's textures on the fly, without exiting from the game. This feature should be useful for the modders interested in creating skins for Rayne.
About the performance of this HD project, well, i can tell you that it runs around a 20-30% slower than the original game, on my 8800 GTX, using my ultra HQ config (1280x1024 SSAA 2x). The new textures need more memory bandwidth, cause they are huge. Anyway, if you turn on the Trilinear Optimization, the performance hit is as low as a 5%, which is ok.
About the memory usage, i can tell you that the 1st level (which uses a huge number of textures) is using 700MB of memory (of the video card), at 1280x1024 SSAA 2x, with the HD Rayne Skin (2048x4096), & with all the enhancements of my patch. So, my 8800GTX with 768MB is optimal for max quality, but if you plan to use 1920x1200 or 2560x1600, you better buy a next gen card with 1 GB of memory.
Anyway, do not worry about these requirements, cause, this is the level that uses more memory, and we are going to create profiles for cards with different memory sizes. Prolly, i'll code a tool to select the best config for your machine.
Well, this is all for now. I remember you, that if you have some skill with photo edition, and you want to contribute, please, contact with me. We need more people to finish asap.
I'm worried about the performance & memory usage of the HD textures.
The first level of the game is using 1 GB of VRAM atm, and the performance drop is considerable, as i said previously. So, i have been researching a little.
A cool user from B3D forum, has been helping me to analyze the performance of the game. These are the results of the analysis:
44.3% of the time limited by core clock (2.73M cycles)
14.2% of the time limited by shader clock (2.05M cycles)
41.5% of the time limited by BW (384 MB)
30.3% of the time limited by core clock (3.38M cycles)
69.7% of the time limited by BW (1169MB)
As resume, with the HD textures, your framerate depends a 70% of your memory bandwidth, and only a 41% with the standard textures.
I'm also planning to upgrade to a 1920x1200 screen, and i'm worried, cause even a GTX280, seems to be not enough for my personal needs. I also was considering to buy a couple of 4870X2 cards, but, unluckily, ATi cards do not support the SSAA modes that i need.
In spite of, i think that there is something that could help to keep the framerate & the memory usage at acceptable levels: Texture Compression.
I have done a test with the new 2048x4096 HD texture used for the Rayne skin. I got 81fps with the HD uncompressed texture, 93fps with the HD compressed texture, and 105fps with the standard res texture. Also, with the texture compression, the memory usage was 4x times lower, so, the game could run on 256MB cards (i hope).
The problem with the texture compression is that you lose image quality, and this is something that i really dislike.
Anyway, i think that there isn't going to be another way to speed up the HD textures, so, i think that an hybrid configurable method that uses compressed & uncompressed textures is the way to go.
I have finished a beta version, with the minimum features to load & use compressed textures. I still need to code some parts like the memory management, and other stuff.
The speed of the game is much better now, and the memory utilization is lower too. The compressed textures raided my framerate from 38fps to 50fps, and lowered the memory usage from +1GB to something close to 512MB. The game runs at 64fps with the original textures. I'm running 1920x1200 SSAA 2x now.
The performance hit is around a 28% now, and it was around a 68% before.
The quality with the compressed textures is as good as with the uncompressed versions. The key is to use uncompressed bump maps, cause the compressed versions create horrible artifacts.
With the new features of the patch, you can customize the level of compression that you want to use per texture. This is great, cause you can create custom profiles for your gfx card, based on your preferences.
The patch uses a new file to configure the textures. It looks like this:
; BloodRayne 2 HD Setup File
; This file contains the information needed by the BR2 FSAA Patch, to replace
; the original textures of BR2, in real time, with the new HD textures.
; Each line uses the following format:
; TEXTURENAME = HEXADECIMALCHECKSUM:VERSIONTOLOAD
; - TEXTURENAME : The name of the original texture to replace.
; - HEXADECIMALCHECKSUM : A 32bit hexadecimal number used by the patch to find the
; original texture in memory, and replace it on the fly.
; It can start with the 0x prefix, but it isn't needed.
; - VERSIONTOLOAD : With this value you can control the version of the HD texture
; that you want to load. You can select these values:
; 0: Use the original texture of the game (no replace).
; 1: Use a DXT1 compressed version of the HD texture (Low Quality).
; 2: Use a DXT3/5 compressed version of the HD texture (Medium Quality).
; 3: Use the uncompressed version of the HD texture (High Quality).
Also, with this new version of the patch, you do not need to modify the original files of the game to replace the textures. The patch will replace the textures on the fly. This way, the new textures will work with all the versions of the game (retail, steam, ... )
Last weekend, i started to work into the SSE4 version of the Perlin code. But, i ended working in a new enhanced SSE3 version.
The new SSE3 version is around a 15-50% faster than the old SSE3 version, so, i'm really proud of it. Everybody will be able to enjoy the enhanced speed (few users have SSE4 atm).
Also, this time, the performance under Vista 64, is much better, cause the new code has only 8 accesses to memory, instead of 11 (in the old version).
This means less stress for the TLB when working in '64bit compatibility mode' (the cpu mode to run 32bit code under a 64bit os). Now XP32 is just a 5% faster (and not a 25%), almost nothing.
If you want to analyze the code, i can provide parts of it, cause i started a big discussion about 64bit vs 32bit performance. People started to jump at me cause i stated that Vista64 was up to a 25% slower than XP32 when running 32bit code.
It's not Vista64, it's the extra overload for the cpu that means running 32bit code in 64bit mode. In the vast majority of cases, the performance hit is really low, but, i found a good case where i can bring the cpu to its knees.
I plan to write a 64bit version of the perlin code, to take advantage of the extra number of SSE registers under 64bit mode, and higher number & width of gp registers. The problem is how to join a 32bit game, with a 64bit process. Well, this is something that i haven't tried yet, but, i think that i could use a pipe, or ipc, ... it's going to be interesting.
The results (Generic C code / old SSE3 code / new SSE3 code) (time in seconds):
And using 4 threads (old SSE3 code / new SSE3 code):
XP-32: 0.75 / 0.64
Vista64: 1.04 / 0.68
Also, i finished the G15 LCD applet, and it looks really cool
It shows the memory used by the HD textures, the CPU load, the free windows memory, information about the geometry of the scene, draw primitives, the debug hud, ... If you have more ideas for it, pm me.
All times are GMT + 1 Hour Goto page 1, 2, 3, 4, 5Next
Page 1 of 5
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum