Author Topic: DX merge - Complete!  (Read 12004 times)

0 Members and 1 Guest are viewing this topic.

Great work Goober, saved me some trouble. Are you still having that problem with fs2_open?

If so could you tell me what the videocard string in the aforementioned freespace 2 registry entry says.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
HKEY_LOCAL_MACHINE\Software\Volition\Freespace2\Videocard sez Direct 3D - Primary Display Driver (640x480).  Yet the DX8 build loads in 1024x768.

And after I ran the SCP launcher, I got that "error initializing direct3d: failed to create device" message, which didn't go away even after I used the retail FS2 launcher.  I had to restore my registry to be able to run FS2 again.

 

Offline RandomTiger

  • Senior Member
  • 211
DX8 FS2 does not use the same registry for vid selections as the others. This means you can still run the original FS2 exe OK.

I'll fix the launcher bug. Do no attempt to change the mode selection method used in the FS2 DX8 code.
« Last Edit: March 21, 2003, 03:38:03 am by 848 »

 

Offline Inquisitor

We should change that, it should use the same registry entries, just like OGL.

That introduces another management crisis otherwise.

Anywho, long overdue for a meeting, I am in Provo next week, how about the week afterwards?
No signature.

 
Quote
Originally posted by RandomTiger
DX8 FS2 does not use the same registry for vid selections as the others. This means you can still run the original FS2 exe OK.

I'll fix the launcher bug. Do no attempt to change the mode selection method used in the FS2 DX8 code.


I see the different registry values RT, but I still don't understand why Goober is getting problems. I modified the dialog box code to automatically pick the most suitable resolution and bit depth for DX8 as the default entry, and it works from the Videocard registry entry.

 

Offline redmenace

  • 211
So call me a simpleton But how is direct x 8 going to change Freespace 2?
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 
Well, it'd let us eventually implement hardware T&L which above all other things would give us the ability to have super-detailed (30000) poly ships and such. You can also do things like specular highlighting and hardware supported bumpmapping and anti-aliasing, just to scratch the surface.

 

Offline redmenace

  • 211
oooooh. A high poly count babylon 5 :D
may be someone will make a new sathanas.
Or maybe a vorlon planet killer.
what is hardware t&l. and what is the benefit of anti lacing?
« Last Edit: March 23, 2003, 12:47:27 am by 887 »
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 

Offline Fry_Day

  • 28
Okay, let's start with hardware T&L.

Basically, a 3d scene is comprised of many vertices (3D points), and lists of polygons that reference to these points (As in, polygon A is made of points 1,2,3, polygon B is made from points 3,4,5, etc.).
To simulate movement, for example, when the viewpoint (the player, generally) moves X units forward, the whole world is actually translated (moved) X units backwards. If the viewpoint turns Y degrees right, the world is rotated Y degrees left.
Rotation and translation (And scaling and shearing, for the matter) are grouped into Transformations.
Up until the GeForce 256, transformations were generally preformed by the CPU with specialized code. The advantage of using the graphics card to do those calculations is that first of all the CPU is offloaded of those calculations, letting it utilize its power in things like AI and physics, and the great advantage comes from general case circuitry (CPUs floating point math units, in this case) are usually an order of magnitude slower than circuitry made for a specific use.

The second part of T&L, lighting, is just as it sounds. What the graphics processor generally does is compute how brightly lit each vertice is, according to the basic lambertian reflection model, which says that the intensity of light on a point is equal to the light's strength multiplied by the cosine of the angle between the light vector, and the normal vector of the point. As vertex normals are usually stored, and both they and the light vectors are generally stored normalized (stored as vectors with the length of 1), and the dot product of two vectors, u·v, is defined as |u|*|v|*cosè (|u| being the length of the vector u, |v| being the length of vector v, and è being theta, the angle between them), |u|*|v| equals one, therefore the dot product gives exactly what is required for the lighting equasion. Sorry if it got too mathematical (Even though it is only basic vectors), but that's about it regarding T&L.

Anti-aliasing is a technique to reduce image artifacts, called aliasing (Makes you wonder how they thought of the name 'Anti-aliasing', eh? :) ), which is a general name for artifacts caused by two inherent problems of the computer monitor. First of all, pixels are inherently square. Therefore, only square shapes can be displayed without any artifacts. Secondly, the resolution of monitors isn't high enough to fool the eye into thinking there are no artifacts (at least not yet). The best case in which you can see aliasing is the 'stair-steppes' effect, where a polygon is nearly horizontal or vertical, and slow-moving on the screen, and you can see how the pixels on the edges of the polygon are slowly moving.
All anti-aliasing algorithms generally draw the image in a sub-pixel precision, and then sample it down to fit the monitor (called 'supersampling', as you draw more pixels than you can see (as in, in a higher resolution), and then sample them down), or just take several samples from the screen and blend them (called multisampling). The result of all of them, to some degree, is eliminating those jaggies, by making the lines have smooth gradients, instead of hard edges.

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
[color=66ff00]I was about to say 'wow Fry_day really knows a lot of 3D mechanics' but I guess that it's pretty common knowledge for todays games programmers. :)

I've only ever messed with 2D graphics, drawing 2D layers and sprites seems a lot less complicated in comparison but I see there are a good deal of similarities between 2D and 3D 'world manipulation' (sorry for the bad decription, I can't think of a more accurate one).
Interesting stuff and well explained. :nod:
[/color]

 

Offline RandomTiger

  • Senior Member
  • 211
Quote
Originally posted by ##UnknownPlayer##


I see the different registry values RT, but I still don't understand why Goober is getting problems. I modified the dialog box code to automatically pick the most suitable resolution and bit depth for DX8 as the default entry, and it works from the Videocard registry entry.


OK, originally I designed DX8 FS2 to not interfere with normal FS2, which at the time was a good idea but now maybe causing problems.

Today I got a crash where the code was trying to run glide then a problem with the resolution. I have fixed both these issues by making use of the Videocard registry enter that I was avoiding in the first place. I am about to send Inquistor the ammended launcher.

But theres another problem which UP will have to attend to. Unless you feel you have a better solution (which would most likely require more work on the launcher) you need to understand the difference in how the mode indices are created.

The external launcher indices all modes and only shows the ones that are valid. The chosen number is stored in the registry to be picked up by the game.

The game DX8 launcher gave index numbers to only the modes that where valid. So you can see the problem, the indices dont match up. The solution is strip out the internal launcher and make the game query for the mode directly with D3d rather than using that array of indices.

Sorry if that not so clear, I have no time sadly. If you have problems or want more clarity or even code give me an e-mail and I'll get onto it as soon as I can.

 
Ok, I'm totally unfamiliar with the external launcher (having never used it) but I get where your coming from RT.

It would be easy enough to remove the internal launcher (I'd need to comment out maybe 10 lines at most - you did a good job), but I'll need to know the specs of what registry entries I'm to be querying to get that the external launcher is telling FS2 launch with, and as importantly, the process it uses to enumerate the list of modes (I could code one, but chances are I'd do something which doesn't result in the indices matching up).

If you could just post me some more info of what I need to do in this thread I'll go right ahead do it.

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
apparently some of the dx8 stuff isn't compiling on my machine

D3DFMT_A2B10G10R10
D3DXSaveSurfaceToFile
D3DXIFF_BMP

are not found in my dx8 stuff
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Inquisitor

Weird.

But i have the full SDK, lemme look at it...
No signature.

 

Offline RandomTiger

  • Senior Member
  • 211
Quote
Originally posted by ##UnknownPlayer##
Ok, I'm totally unfamiliar with the external launcher (having never used it) but I get where your coming from RT.

It would be easy enough to remove the internal launcher (I'd need to comment out maybe 10 lines at most - you did a good job), but I'll need to know the specs of what registry entries I'm to be querying to get that the external launcher is telling FS2 launch with, and as importantly, the process it uses to enumerate the list of modes (I could code one, but chances are I'd do something which doesn't result in the indices matching up).

If you could just post me some more info of what I need to do in this thread I'll go right ahead do it.


Please contact me with questions by e-mail, Im sorry I really dont have time to keep up with the boards at the moment.