Improving performance:
=================
extract:
Use SoftwareVertexProcessing
Dim flags As Direct3D.CreateFlags = CreateFlags.SoftwareVertexProcessing
Get the capability of the device
Dim caps As Direct3D.Caps = Manager.GetDeviceCaps(0, eviceType.Hardware)
Use HardwareVertexProcessing
If caps.DeviceCaps.SupportsHardwareTransformAndLight Then
flags = CreateFlags.HardwareVertexProcessing
End If
Use PureDevice
If caps.DeviceCaps.SupportsPureDevice Then
flags = flags Or CreateFlags.PureDevice
End If
device = New Device(0, DeviceType.Hardware, Me, flags, presentParams)
This way, the vertex processing will be done in Hardware if your hardware is supporting it. My game improve > 10% after Ive done that.
Use Option Strict ON
I think those who have read Toms book know the nightmare of the Boxing and Unboxing. Try minimise the Boxing and Unboxing work in your application. The best example is the C++ version of billboard and C# version of it. C# version run at 60% of the C++ version, bcs of the Boxing and Unboxing thingy.
2D Performance
Im not using the ZBuffer for my game. Its a waste anyway. Disable some of the 3D option can help the performance of your 2D application.
Transparency:
==========
I used .PNG graphics for my game actually. I save spaces and save work on the transparency.
Im actually looking for WAYS how to shrink the memory consumption, if anyone in this forum know, can you share with us?
=================
extract:
Use SoftwareVertexProcessing
Dim flags As Direct3D.CreateFlags = CreateFlags.SoftwareVertexProcessing
Get the capability of the device
Dim caps As Direct3D.Caps = Manager.GetDeviceCaps(0, eviceType.Hardware)
Use HardwareVertexProcessing
If caps.DeviceCaps.SupportsHardwareTransformAndLight Then
flags = CreateFlags.HardwareVertexProcessing
End If
Use PureDevice
If caps.DeviceCaps.SupportsPureDevice Then
flags = flags Or CreateFlags.PureDevice
End If
device = New Device(0, DeviceType.Hardware, Me, flags, presentParams)
This way, the vertex processing will be done in Hardware if your hardware is supporting it. My game improve > 10% after Ive done that.
Use Option Strict ON
I think those who have read Toms book know the nightmare of the Boxing and Unboxing. Try minimise the Boxing and Unboxing work in your application. The best example is the C++ version of billboard and C# version of it. C# version run at 60% of the C++ version, bcs of the Boxing and Unboxing thingy.
2D Performance
Im not using the ZBuffer for my game. Its a waste anyway. Disable some of the 3D option can help the performance of your 2D application.
Transparency:
==========
I used .PNG graphics for my game actually. I save spaces and save work on the transparency.
Im actually looking for WAYS how to shrink the memory consumption, if anyone in this forum know, can you share with us?
Last edited by a moderator: