Lights in DX versus OGL

Started by
3 comments, last by Seriema 21 years, 2 months ago
Hi! I''m making a simple 3D engine to learn 3D engine programming *daa* My main goal is to learn OGL _and_ DX! That''s why I try as hard as I can to hide all API specific stuff, mostly behind inheritance (C++). Right now I''m making it in OGL (don''t flame me! ). Know I''m making light sources and materials... How is light represented in DX? Is it like in OGL with float[4] ? One for each component (diffuse, specular, etc) ? thanx... "No lies of sugar can sweeten the sournes of reality" }+TITANIUM+{ A.K.A. DXnewbie[onMIRC]
[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. ] [ Chocolate peanuts: Brazilian recipe for home made chocolate covered peanuts. Pure coding pleasure. ]
Advertisement
The most rigorous (and probably most correct) answer can be found in the sdk documentation as well as the sdk "tutorial" samples. Take a look and then write back if you have specific questions.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
They seem to us D3DCOLOR and such?...

Should I make a color and a vector class that hides the inplementation in either cDXColor/cOGLColor and cDXVector/cOGLVector ?

Does anyone know of a engine (with docs, tuts?) that have done the same? (hiding away the API specifik stuff to increase compability?)

"No lies of sugar can sweeten the sournes of reality"

}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]
[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. ] [ Chocolate peanuts: Brazilian recipe for home made chocolate covered peanuts. Pure coding pleasure. ]
While I can''t think of any in specific, I like the way you''re thinking and I think that''s the way you should go about it. In fact, that''s how I''m going to go about it. ;P
quote:Does anyone know of a engine (with docs, tuts?) that have done the same? (hiding away the API specifik stuff to increase compability?)


Yup, take a look at the Ogre engine. It''s written in C++, has separate render systems for DirectX 7, DirectX 8 and SDL/OpenGL, and seems to be fairly well documented.

I can''t recommend trying to abstract both APIs until you''ve hammered down the requirements of your engine. You''ll undoubtedly have to make trade offs that depend on the type of game you''re writing.

You should also read S1CA''s post in this thread. He has some excellent advice on the subject.

This topic is closed to new replies.

Advertisement