Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

140 Neutral

About Monza

  • Rank
  1. I'm sure the 'measurestring' returned rectangle is the size of the string if it was rendered to the screen without scaling or transformation.  It appears to be based on the size and number of lines of the rendered font.  Which would be fine if I was sending it to the screen without transformation.   But the sprite is set to 'objectspace' which transforms and renders it into the scene at a completely different size.  This is the size I need (so I can calculate how to draw a bounding box around the text).   Maybe I can 'project' the font sprite bounding box coordinates into the scene to work out the size?
  2. Trying to get the rendered bounding rectangle from a font sprite set to render into objectspace (not screen space) coordinates.   But the d3d9Font.measurestring(sprite .......    only gives the non objectspace rectangle even through the sprite is defined to render in objectspace.   So basically, even though the font is rendered into the 3D scene correctly at the correct depth and perspective based size (eg the same sized font may range from a few to 500 pixels of more depending on depth), I cannot get this size rectangle, because the measurestring only returns a fixed size (eg 250 x 100) regardless of rendered depth as if it was rendered directly to screen with objectspace not set (ie in transformed coordinates)   Do I need to use the defined sprite transformation matrix in another calculation or am I missing something?   Is there another way to compute the final text rendered screen size?  
  3. Yeah - shouldn't have to pander to these cards, My graphics structure may be a little difference to yours. I ended up grouping the textured polygons in the index buffer array and then setting up another ordinary integer array which pointed to the first element of the indexed buffer array of each texture group for each primitive call. Kind of messy, but it worked 100%. But other issue were that some cards did not support 32 bit buffers (older Intel graphics) which was a pain for larger index groups. Later on, I decided to get rid of indexed primitives all together, and then I just grouped the elements directly into a large vertexbuffer and then called the different parts with DRAWPRIMITIVES using offsets and lengths as required.
  4. I found when drawing indexed primitives the minVertexIndex parameter cannot be left at zero with ATI cards for some reason. NVIDIA and INTEL seem to work fine however. When I left this at zero, the ATI cards were missing polygons all over the place. So your call " ->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, m_VertexBuffer.m_NumVertices, index0, numIndices/3); " must change to a variation like " ->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, m_MinIndexNumber, m_VertexBuffer.m_NumVertices, index0, numIndices/3); " see the MSDN entry "The minVertexIndex and numVertices parameters specify the range of vertex indices used for each call to DrawIndexedPrimitives. These vertex indices are used to optimize vertex processing of indexed primitives by processing a sequential range of vertices prior to indexing into them. Indices used during this call cannot reference any vertices outside this range. http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.graphicsdevice.drawindexedprimitives.aspx "
  5. Had a similar problem with ATI cards not drawing some indexed textured primitives. Seem to remember I had to explicitly specify buffer offsets or something to assist the card whereas this could be ignored for nvidia or intel cards. Can probably chase up the change required if it seems like a similar problem.
  6. I had the same problem with billboarding - so I gave up using it. A relatively easy solution which still uses text sprites is to switch to using screen coordinates instead of world coordinates (ie don't use the SpriteFlags.ObjectSpace flag when beginning the sprite). Just get the screen coordinates from the real world coordinates using the slimdx UNPROJECT method, and use these coordinates to write your sprite to the screen (which will now always be upright and straight). You can even adjust whether you want the text to appear in front of all other graphics by adjusting the Z value of the returned vector3 screen coordinates which control the z-buffer location.
  7. The samples use an early version of SLIMDX. Unfortunately some of the methods used in the framework are now depreciated and no longer work with recent versions of SLIMDX. The simple examples such as 'Simple Tri" which do not use the framework will work if you relink the SLIMDX dll resource in the archive.
  8. I need to display a similar set of geometry (consisting of tens of thousands of objects each with dozens of polygons) in multiple windows. I've done this using swap chains which works OK, but because the geometry objects need to have different colors in each windows, I've had to create duplicate vertex arrays and buffers (transformed vertexes, normals and colors) for each window, which chews up lots of memory and needs some management. Is there any way to utilize the same vertex arrays or buffers, but individually color the vertexes for each window? Or am I stuck with creating and managing multiple vertex arrays and buffers for each window?
  9. Monza

    DirectX9 VB.Net Resizing Window

    OK - I see. SLIMDX is largely a .NET wrapper library to DirectX. I use it for my VB.NET code, and it supports everything from DX9 to DX11, in both 32 and 64 bit.
  10. Monza

    DirectX9 VB.Net Resizing Window

    Is that the latest Microsoft Direct3D library you are using? As a user of SLIMDX with VB.NET I'd be interested in hearing your thoughts on the microsoft library.
  11. Kind of the opposite I guess. I'm trying to render the exising transparent portion of the texture opaque in a color of my choosing. I guess I could recreate the texture with a defined background color, but I'd rather dynamically change the transparent portion when I render. (DirectX 9.0c)
  12. Probably a dumb question, but I've wasted some time on it. I have some font textures that I need to optionally show either in the foreground with a solid background, or within the scene with transparent background. The transparent option is no problem, with zbuffer enabled and alpha blending enabled Is there a way I can display same texture in the foreground with a custom background color (apart from recreating the texture with a set background color, or painting a colored polygon behind the texture tile). Disabling the zbuffer places the text in the foreground, but disabling aplha blending only renders the background BLACK.
  13. Hi, fairly new at this, and need some advice. I'm writing a CAD type program in VB.NET using DX9 and SLIMDX using only Fixed Pipeline functions. All going well, and displaying around 1,000,000 primitives fairly smoothly. However. One part which is killing performance is displaying 20-30,000 different sized spheres using the Mesh.DrawSubset command in a loop to transform a common mesh and position copies around the 3D world, every frame Can I load these into a static vertex buffer, or maybe create triangle primitives from the mesh to do the same? How? Thanks in advance for any pointers
  14. Yep - used the same procedure here, and all OK. Scratching in the dark here, but maybe try setting SPECIFIC VERSION to TRUE in reference properties. Make sure no other version of SLIMDX is installed in the Windows Programs listings. Also, what happenings if you BROWSE and point to a specific instance of the SLIMDX.DLL, rather than using the .NET listings?
  15. I use .NET 2.0, with Studio 2010 and vb.net with SlimDX. No problems noticed with my app, although I did have a problem on one computer where I had to uninstall and then reinstall the SlimDx runtime. What version of SlimDX dll reference are you targeting?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!