SoftwareVertexProcessing is leaving some part empty

I have been banging my head on the wall over my codee which doesn't seem to be working fully.

I am displaying Sprite's, text, backgrounds and you name it (all 2D) on the screen, the only thing that is not working is the text.

The code works on some computer and others not, which was a really big mystery to me.
After some serious debug of each and every line, I found out that the code is doing it thing, there was nothing wrong with it (I am displaying text using my own code).

Then I found out what the problem was, this is what I do in the beggining:

CreateFlags flags = CreateFlags.SoftwareVertexProcessing;
if (caps.DeviceCaps.SupportsHardwareTransformAndLight) // <--- Real problem
flags = CreateFlags.HardwareVertexProcessing;

if (caps.DeviceCaps.SupportsPureDevice)
flags |= CreateFlags.PureDevice;

if the computer graphic card doesn't support HardwareTransformAndLight, then the text wont be display'd.
This looks to me like SoftwareVertexProcessing is not doing what it is suposed to do or that I need to change the format of the text I use.


EDIT:
The text is invisible but it is on the screen (tested with custom textbox, the cursor moved properly while the text was invisible.)
I dont expect people will be able to read invisible text ;)



Answer this question

SoftwareVertexProcessing is leaving some part empty

  • PatGO

    Normally a good starting point is to activate the debug runtime and look at the output as it can tell you most times if you make something wrong.

    It is a known fact that the software vertex processing is more sensible if it come to the parameter in your Draw calls than hardware vertex processing. Especially in the case you have nVidia drivers and hardware. If you use indexed draw calls you should check the MinIndex and NumVertices parameter. Wrong values there are often ignored from the hardware vertex pipeline but not from the software version.



  • Ken Morley

    After long hours of sweet and tears, we found out that the software doesnt support a 0 rhw component as good as hardware and ofcourse we forgot to put 1.0 there in the text renderer.


  • SmartDumb

    Ok, some updates:

    I have single image containing everything, then I use VertexPointer to retreave a single tile inside that image (in our case, letter). I use the VertexPointer to retreave all 4 corners of the letter (the values are all correct, checked it out) but what it is suposed to do (and does do in some computers) is that it retreaves the image inside these 4 corners, however after some serious debugging, the software is retreaving a single pixel and uses that to fill it up (while the hardware doesn't).
    The image contains the letter and the background is transparency (which explains why the letters are invisible, it is retreaving only a single pixel (I think it is one of the corners) and fills the space that is suposed to contain the letter, with it, so instead of a etc. 16 x 16 image of an image, it fills up that space with a single pixel (and in this case, transparency))

    Please let me know why the software is failing doing this (and maybe other methods) so I can fix this as soon as possible.

    I am not willing to use Microsoft.DirectX.Direct3D.Font as it has failed me several times.


  • SoftwareVertexProcessing is leaving some part empty