Jump to content
  • Advertisement

clashie

Member
  • Content Count

    111
  • Joined

  • Last visited

Community Reputation

633 Good

About clashie

  • Rank
    Member
  1. clashie

    D3D11 - Bitmap Font Rendering

      Yes, my font is just packed into a texture. I wrote a tool that generates bitmap fonts and it also creates the glyph data I need alongside the actual texture.   So when I pass a character, it's indexes to an array with information for drawing it so I have the character's bounds, texture coordinates and whatever else I needed.
  2. clashie

    D3D11 - Bitmap Font Rendering

    I just do the naive thing with 2D and it seems quite fast. Even on older hardware I could throw tens of thousands of them around like it was nothing.   I pre-fill a static 16 bit index buffer and create a dynamic vertex buffer for my sprites. I create the sprite geometry each frame and do some basic sorting and batching. It's pretty easy to batch large amounts of the sprites into a single draw call. Buffers for it are created once up front and destroyed only at the end.   Since the index buffer was 16 bit, I capped the number of sprites at 10922 per draw call.   (10922 * 4) * sizeof(Vertex2D)... which was 32. So 1398016 bytes for the vertex buffer. About 1.4mb.
  3. clashie

    Vulkan is Next-Gen OpenGL

      The drivers at release were indeed broken. It's since been fixed, so redownload them.
  4. clashie

    Vulkan is Next-Gen OpenGL

      You and me both. And what looks like others, according to google.   AMD goof?
  5. clashie

    Rendering a GUI efficiently

    I dunno if it's optimal how I have my stuff set up, but I have a simple sprite batching class that I use to draw quads with. I don't really do anything special at all.   SpriteBatch manages the state, etc. It's really dead simple and really doesn't do that much work internally. Just tracking a few things, starting a new batch, finally issuing the draw call, etc. I pre-fill the index buffer and cap how large batches can get. Adding a sprite to the batch just needs a Rect for the position and another for the texture coordinates.   A batch is a simple struct like this struct Batch { Vertex2D* verts; Texture* texture; u32 numSprites; u32 numVerts; u32 numIndicies; };  Then keep a vector of them. Batches hang around until you explicitly purge them, so once you add a bunch of quads, you don't need to re-add them and the only thing that needs to happen is the draw call (and prior memcpy() to push whatever batch verts to the underlying vertex buffer).   It's not fancy or super robust, but I don't see why I couldn't draw an entire UI with just one or two draw calls. Drawing thousands of textured quads costs practically nothing, and my framerate is still well into the thousands. What's GWEN doing that's taking so long?
  6. If you trip the thermal limit, the machine will just likely shut off instantly before the part is damaged. It's also not unusual for the driver to crash if the hardware is extremely hot.   When my GTX 260's fan died, I was pushing nearly 110c with even the most minor activity. The driver would crash continually and if it kept climbing, poof, computer would just turn off. The metal backing was actually so hot that I probably could of burned myself on it. Check your temperatures!
  7. clashie

    In-Game Console

    The actual logic behind a console system isn't too hard to put together, I have a simple Cvar class which uses template specializations for the argument types I support (float, int, string, and nothing) so when you create a Cvar object, it sets an internal flag accordingly for the type you tried to give it so it knows how to act on it later. It uses a FastDelegate internally for the function pointer stuff.   Then I just dump them into a map<string, Cvar> for the lookup. The Console class has an exec() function which just takes a string -- if there's 2 parts to it (like "test 500") then I split that into to name and argument, use the name for the lookup, and 500 is converted and handled accordingly. It's not really robust, but it's really tiny and simple, I think the whole thing is like around 150 lines.
  8. clashie

    Shader semantics

    Seems kind of weird that they just leave things off their list, but whatever, I guess it doesn't really matter. Now that things are working, I made it into a starfield. Pretty neat how I can just draw the whole thing in one call, and they can all be uniquely scaled, rotated, etc. https://dl.dropbox.com/u/10565193/d/starfield.png edit: Also solving things shortly after I post seems to be a trend of mine. I'm apparently incapable of working things out before I get annoyed and go to ask for help.
  9. clashie

    Shader semantics

    Actually I'm retarded and solved that. I done goofed somewhere and I wasn't giving CreateInputLayout() the right number. I have pretty triangles spread about again. Still curious as to why the MSDN list of semantics is apparently incomplete, and if I should be trying to pad stuff out to a certain size.
  10. clashie

    Shader semantics

    Which is one of the problems, why doesn't MSDN have the complete list of these things? It doesn't even mention that WORLDVIEW exists. :/ Ok, before I just used a single vector for my instance position, but I want to be able to rotate, scale, etc, so I figured I'd just make use a matrix instead. So before, I just did something like this:layout[2].SemanticName = "TEXCOORD"; layout[2].SemanticIndex = 0; layout[2].Format = DXGI_FORMAT_R32G32B32A32_FLOAT; layout[2].InputSlot = 1; layout[2].AlignedByteOffset = 0; layout[2].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; layout[2].InstanceDataStepRate = 1; ... VOut vs(float4 pos : POSITION, float4 col : COLOR, float4 ins : TEXCOORD0) { VOut output; pos.x += ins.x; pos.y += ins.y; ... Ok, bam, works. But I'm not sure what I'm doing wrong here trying to access my matrix. I changed my input layout to this:layout[2].SemanticName = "TEXCOORD"; layout[2].SemanticIndex = 0; layout[2].Format = DXGI_FORMAT_R32G32B32A32_FLOAT; layout[2].InputSlot = 1; layout[2].AlignedByteOffset = 0; layout[2].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; layout[2].InstanceDataStepRate = 1; layout[3].SemanticName = "TEXCOORD"; layout[3].SemanticIndex = 1; layout[3].Format = DXGI_FORMAT_R32G32B32A32_FLOAT; layout[3].InputSlot = 1; layout[3].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT; layout[3].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; layout[3].InstanceDataStepRate = 1; layout[4].SemanticName = "TEXCOORD"; layout[4].SemanticIndex = 2; layout[4].Format = DXGI_FORMAT_R32G32B32A32_FLOAT; layout[4].InputSlot = 1; layout[4].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT; layout[4].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; layout[4].InstanceDataStepRate = 1; layout[5].SemanticName = "TEXCOORD"; layout[5].SemanticIndex = 3; layout[5].Format = DXGI_FORMAT_R32G32B32A32_FLOAT; layout[5].InputSlot = 1; layout[5].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT; layout[5].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; layout[5].InstanceDataStepRate = 1; ... The post I linked makes it look like I can just do something like this: VOut vs(float4 pos : POSITION, float4 col : COLOR, float4x4 ins : TEXCOORD) { VOut output; pos = mul(pos, ins); ... The shader seems to compile fine, but the runtime immediately complains that:D3D11: ERROR: ID3D11Device::CreateInputLayout: The provided input signature expects to read an element with SemanticName/Index: 'TEXCOORD'/1, but the declaration doesn't provide a matching name. [ STATE_CREATION ERROR #163: CREATEINPUTLAYOUT_MISSINGELEMENT ] On creation of the input layout.
  11. I want to use a matrix for my instance position and stuff instead of just a vector, but I don't see a semantic for anything more than float4. I'm using a second vertex buffer for my instance data. Looking here, I see nothing for a matrix / float4x4. http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647 This, however, makes it look like I can do it, but I have to have 4 seperate parts for the input layout, then I can just simply use it as a float4x4 in the shader? Is that right? http://www.gamedev.net/topic/608857-dx11-how-to-transfer-matrix-to-vs/ But what is WORLDVIEW? Why isn't it on the MSDN list? Also, should I be striving to pad my structures out to a specific size?
  12. clashie

    Could Not initialize Direct3D

    Make sure that you're definitely ending up picking the 10 feature level. You'll also need to change the shader profile argument for D3DX11CompileFromFile. It's probably "ps_5_0" / "vs_5_0" right now. Change it accordingly -- on your card you'd need to use 4 instead.
  13. clashie

    C++ panel rendering

    It's probably just drawing straight to the window itself, not a specific control. If you're in need of a framebuffer to just dump pixels to, the simplest way on Windows is probably a DIB Section. It's just a few lines to init and you'll just get a pointer directly to the data, BitBlt() to the screen when you're done.
  14. Why not just mod Skyrim? The base is there and you have everything you need to make a completely new game. Look at Nehrim for Oblivion. It uses the assets (and I'd assume plenty of their own as well), but it's still an entirely new world in the end.
  15. clashie

    Alphablend - VB6/ASM

    I've used this before: http://stereopsis.com/doubleblend.html and have another SSE version for images where I can take advantage of operating on multiple pixels at the same time. Also why are you using VB6? It's dead.
  • 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!