Thread: Re: [GD-Windows] From OGL To D3D
Brought to you by:
vexxed72
From: Rich <leg...@xm...> - 2002-02-08 18:29:27
|
In article <3C6...@sd...>, Dave Smith <dav...@sd...> writes: > Before I embark on this great quest of porting some of my code > from OGL to D3D, I would like to know if there are any good > sites that discuss this issue. Its not a porting guide, but perhaps this will help? <http://www.xmission.com/~legalize/d3d-vs-opengl.html> -- Ask me about my upcoming book on Direct3D from Addison-Wesley! Direct3D Book <http://www.xmission.com/~legalize/book/> Don't Support Spammers! Boycott Fractal Painter 7! <http://www.xmission.com/~legalize/spammers.html> |
From: Paul B. <pa...@mi...> - 2002-02-09 04:30:38
|
OpenGL uses -1 < w < 1 for the clip space, while D3D=20 uses 0 < w < 1 which for practical purposes means you have to scale (or divide) by two in some places to get exact visual similarity. I don't remember the details either, but I think that was the biggest problem. Paul > -----Original Message----- > From: Brian Hook [mailto:bri...@py...]=20 > Sent: Friday, February 08, 2002 11:00 AM > To: gam...@li... > Subject: Re: [GD-Windows] From OGL To D3D >=20 >=20 > At 11:49 AM 2/8/2002 -0500, Dave Smith wrote: > >Before I embark on this great quest of porting some of my=20 > code from OGL=20 > >to D3D, I would like to know if there are any good sites=20 > that discuss=20 > >this issue. >=20 > No sites, unfortunately, at least that I'm aware of. >=20 > If you're targeting DX8, then the transition should be fairly smooth=20 > (depending on how much OGL you were using). Most of the=20 > state stuff has=20 > direct analogs. Probably the biggest area of confusion for=20 > me was making=20 > sure my matrices were matching correctly. I don't remember the exact=20 > details, but it took some trial and error before I figured=20 > out how to map=20 > an OpenGL projection matrix to the D3D one. >=20 > Brian >=20 >=20 > _______________________________________________ > Gamedevlists-windows mailing list=20 > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 |
From: Brian H. <bri...@py...> - 2002-02-09 04:34:13
|
They also differ in handedness. And the extra world matrix in D3D adds some complication (potentially -- I just keep it at identity). Brian At 10:30 PM 2/8/2002 -0600, Paul Bleisch wrote: >OpenGL uses -1 < w < 1 for the clip space, while D3D >uses 0 < w < 1 which for practical purposes means you >have to scale (or divide) by two in some places to get >exact visual similarity. I don't remember the details >either, but I think that was the biggest problem. > >Paul > > > > -----Original Message----- > > From: Brian Hook [mailto:bri...@py...] > > Sent: Friday, February 08, 2002 11:00 AM > > To: gam...@li... > > Subject: Re: [GD-Windows] From OGL To D3D > > > > > > At 11:49 AM 2/8/2002 -0500, Dave Smith wrote: > > >Before I embark on this great quest of porting some of my > > code from OGL > > >to D3D, I would like to know if there are any good sites > > that discuss > > >this issue. > > > > No sites, unfortunately, at least that I'm aware of. > > > > If you're targeting DX8, then the transition should be fairly smooth > > (depending on how much OGL you were using). Most of the > > state stuff has > > direct analogs. Probably the biggest area of confusion for > > me was making > > sure my matrices were matching correctly. I don't remember the exact > > details, but it took some trial and error before I figured > > out how to map > > an OpenGL projection matrix to the D3D one. > > > > Brian > > > > > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > >_______________________________________________ >Gamedevlists-windows mailing list >Gam...@li... >https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Tom F. <to...@mu...> - 2002-02-11 10:45:06
|
And the matrices are the other way up. Except they're not. :-) The matrices in OpenGL and D3D are notionally different - one does matrix*columnvector, the other does rowvector*matrix (IIRC), which means that the matrices used are the transpose of each other. Except that as well as the notation being different, the actual order the values are stored in memory is different. So in one a row is stored as four consecutive floats, in the other a _column_ is stored as consecutive floats. These two effects cancel each other out, with the result that a given sixteen floats in memory is correct for both systems, even if the actual names the components are given is different. Yeah, just keep the world matrix at identity and all is fine. Tom Forsyth - Muckyfoot bloke. What's he up to now (and can I have a go)? http://www.eidosinteractive.com/downloads/search.html?gmid=86 > -----Original Message----- > From: Brian Hook [mailto:bri...@py...] > Sent: 09 February 2002 04:34 > To: gam...@li... > Subject: RE: [GD-Windows] From OGL To D3D > > > They also differ in handedness. And the extra world matrix > in D3D adds > some complication (potentially -- I just keep it at identity). > > Brian > > At 10:30 PM 2/8/2002 -0600, Paul Bleisch wrote: > > >OpenGL uses -1 < w < 1 for the clip space, while D3D > >uses 0 < w < 1 which for practical purposes means you > >have to scale (or divide) by two in some places to get > >exact visual similarity. I don't remember the details > >either, but I think that was the biggest problem. > > > >Paul > > > > > > > -----Original Message----- > > > From: Brian Hook [mailto:bri...@py...] > > > Sent: Friday, February 08, 2002 11:00 AM > > > To: gam...@li... > > > Subject: Re: [GD-Windows] From OGL To D3D > > > > > > > > > At 11:49 AM 2/8/2002 -0500, Dave Smith wrote: > > > >Before I embark on this great quest of porting some of my > > > code from OGL > > > >to D3D, I would like to know if there are any good sites > > > that discuss > > > >this issue. > > > > > > No sites, unfortunately, at least that I'm aware of. > > > > > > If you're targeting DX8, then the transition should be > fairly smooth > > > (depending on how much OGL you were using). Most of the > > > state stuff has > > > direct analogs. Probably the biggest area of confusion for > > > me was making > > > sure my matrices were matching correctly. I don't > remember the exact > > > details, but it took some trial and error before I figured > > > out how to map > > > an OpenGL projection matrix to the D3D one. > > > > > > Brian > > > > > > > > > _______________________________________________ > > > Gamedevlists-windows mailing list > > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > >_______________________________________________ >Gamedevlists-windows mailing list >Gam...@li... >https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_idU5 _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |