Setting up Lights and determining DX version 
Author Message
 Setting up Lights and determining DX version

Hi all, got two questions, I'm fairly new to DX programming, but got
the hang of it...I think, just want to make sure I'm doing this right,
as a program I'm writing doesn't allways work the same on all PCs...no
change there eh?....anyway....

First of all, is there any way the program can determine the version
(if any) of DirectX installed on the user's PC, so I can pop up a
MSGBOX to let the user know they need a higher version. All I do at
the moment is trap an error when it tries to create the Device. I
don't include the Redistribution of DX with the app, as its on the
net, I just direct them towards the Microsoft DX site so they can grab
it themselfs.

Next, there seems to be a problem with lighting. the part of my app
that has the windowed D3D view, is fairly simple, several objects
around the 3D world, lit up with a POINT light and an ambient light,
using this code:

MainLight.Type = D3DLIGHT_POINT
MainLight.diffuse.r = 0.1
MainLight.diffuse.g = 0.1
MainLight.diffuse.b = 0.1
MainLight.Range = 1000000
g_D3DDevice.SetLight 0, MainLight
g_D3DDevice.LightEnable 0, 1
g_D3DDevice.SetRenderState D3DRS_LIGHTING, 1
g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H808080

Theres a bit of code later that positions the light rather than leave
it at 0,0,0

Works fine on mine, and alot of other PCs, but on some, it seems light
MainLight doesn't shine, so its quite dark with just the ambient
lighting.

I understand theres some features that certain cards can't handle, but
surely lighting is fairly standard on all DX compatable cards ?

I'm using DX 8.1
(my card...which works great...is a ATI AIW 128)

Any help and Suggestions are welcome

TIA,

Scott (AKA Forge)



Sat, 22 May 2004 04:40:34 GMT  
 Setting up Lights and determining DX version
see the GetDXVer sample in the misc folder.

there is also now a lighting sample in the 8.1 SDK, which was not there for
8.0.

--
Phil Taylor
PM : DirectX SDK, Managed DirectX, WindowsXP Inbox 3D Screensavers, and a
few more bits and bobs
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:

> Hi all, got two questions, I'm fairly new to DX programming, but got
> the hang of it...I think, just want to make sure I'm doing this right,
> as a program I'm writing doesn't allways work the same on all PCs...no
> change there eh?....anyway....

> First of all, is there any way the program can determine the version
> (if any) of DirectX installed on the user's PC, so I can pop up a
> MSGBOX to let the user know they need a higher version. All I do at
> the moment is trap an error when it tries to create the Device. I
> don't include the Redistribution of DX with the app, as its on the
> net, I just direct them towards the Microsoft DX site so they can grab
> it themselfs.

> Next, there seems to be a problem with lighting. the part of my app
> that has the windowed D3D view, is fairly simple, several objects
> around the 3D world, lit up with a POINT light and an ambient light,
> using this code:

> MainLight.Type = D3DLIGHT_POINT
> MainLight.diffuse.r = 0.1
> MainLight.diffuse.g = 0.1
> MainLight.diffuse.b = 0.1
> MainLight.Range = 1000000
> g_D3DDevice.SetLight 0, MainLight
> g_D3DDevice.LightEnable 0, 1
> g_D3DDevice.SetRenderState D3DRS_LIGHTING, 1
> g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H808080

> Theres a bit of code later that positions the light rather than leave
> it at 0,0,0

> Works fine on mine, and alot of other PCs, but on some, it seems light
> MainLight doesn't shine, so its quite dark with just the ambient
> lighting.

> I understand theres some features that certain cards can't handle, but
> surely lighting is fairly standard on all DX compatable cards ?

> I'm using DX 8.1
> (my card...which works great...is a ATI AIW 128)

> Any help and Suggestions are welcome

> TIA,

> Scott (AKA Forge)



Sat, 22 May 2004 06:07:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Determine DAO Registry Setting and Version Being Used

2. How to determine if a Point is visible using DX

3. DX version

4. DX Release Versions

5. Finding DX Version?

6. Determine the runtime version and compiled version?

7. SET UPS: Please Stop... AND Lood

8. Multiple light sources with ambient lighting.

9. Determining Access version number

10. Determining which version of Access is installed

11. how to determine current version of Access thru code

12. Determine Access version from VBA code

 

 
Powered by phpBB® Forum Software