Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Captaintoottoot

Built Doom3 code is slower

Recommended Posts

I downloaded the D3 engine code. Followed the instructions to get it to compile. Made a new exe and dll. Then I went into a test map. with r_showprimitives the count was something like 60,000 triangles. I exited the game. Then re-entered the game with the original unaltered doom3.exe and the count was 35,000... I was in the same spot looking in the same direction. Something is being rendered that shouldn't be. There are some particle effects going on around the map and that's the only thing that I could think of that would cause that much change.

What difference between the original doom3 and the released code could be doing this? Does anyone know where the extra triangles are coming from and what could be done to get the values the same as the original doom3.exe ?

Share this post


Link to post

Well, the released Doom 3 source uses a different algorithm for calculating the shadow volumes because of a patent someone holds. That could be it.

Share this post


Link to post

Did you build debug or release in Visual Studio? For an engine of Doom 3's complexity, the difference is enormous. I ask because Visual Studio seems to always default to debug build when you open a new project.

Share this post


Link to post

I seem to recall a certain community made an edit of the source code to create better shadows that were similar to the original, you could try searching for it.

Share this post


Link to post
Linguica said:

Well, the released Doom 3 source uses a different algorithm for calculating the shadow volumes because of a patent someone holds. That could be it.


That's exactly what it is. When we used the released source code and went standalone with Hexen: EOC, and experienced the same slowdown, I asked Carmack about it on Twitter. He told me that the 'Carmack's Reverse' algorithm had been removed to avoid infringing on the Creative Labs patent. We since added a community-created version of it back, and got the speed back to normal.

Share this post


Link to post

Caffeine Freak, did you know of a link to this revised version?

Quasar, yes it was set to release rather than debug.

Edit:
Ok I see the links to the patch thing for hexen EOC. I would prefer not to patch over anything. Is there a link anywhere to the engine source code? So I can examine the difference between it and vanilla D3 source?

Share this post


Link to post

Unless I'm mistaken, the Hexen: EOC patch you're referring to was for something completely different (a freeze on a particular level.) When I said we went standalone, I meant we did internally (the standalone version of EOC has not been released yet.)

Anyway, I don't know where you'd find the community-created fix that we used, as we got it from the now-defunct doom3world forums. You might try the id Tech forums that replaced doom3world: http://idtechforums.fuzzylogicinc.com

As I recall, the fix was created by a user known as 'raynorpat' on Doom3world, so if he migrated over to the id tech forums like many of the other regulars, he probably uses the same name.

Share this post


Link to post

I checked out a link through the inside3d forums that showed how to put the patented carmack's reverse back in, because I just wanted to rule out if that was causing the performance difference. And... no difference. The tris counts were the same: 23,000 original D3, 35,000 rebuilt D3. Shadows: 10,000 original, 21,000 rebuilt. Something else is different that's causing this and it's not Carmack's Reverse not being there.

I Removed all particles on the map. Result: No change.
I Removed the skybox. Result: No change
I set all lights to noshadows and ambientLight 1 then I saw a change. The numbers between original and rebuilt are the same now, with shadow count to 0 obviously. and exact same tris counts.

So the clue is it has something to do with shadows. Anyone have any guesses what's different between the original D3 exe and the rebuilt exe that would do this?

Share this post


Link to post

At this point, I'm puzzled. Can you paste links to exactly where you got the code and instructions? I *know* that we got the performance boosts once we put the re-created Carmack's Reverse code back in because I checked the numbers, but maybe there's something different about the code you're using.

Share this post


Link to post

Sorry for the delay here but I got snowed in for more than a week and I can only get on the net when I'm in town... It would take me foever to try to find the link to restoring the carmacks reverse. I think it was github or something. From what I saw, restoring Carmack's reverse was basically just altering a couple lines in a file I can't even remember. I thought it seemed too simple to be true. Was it something really that simple or did it require altering a lot more to get the carmack's reverse working again?

Share this post


Link to post

I distinctly remember Carmack saying via Twitter that all he did to avoid the patent lawsuit was remove two lines of code. So yeah.

As far as the steps you would take to compile it correctly, I don't know.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×