Jump to content
  • Advertisement

Eric F.

GDNet+ Pro
  • Content count

    26
  • Joined

  • Last visited

Community Reputation

264 Neutral

About Eric F.

  • Rank
    Member

Personal Information

Social

  • Twitter
    efortier
  • Steam
    efortier
  1. Hi all. I'm looking for a font to test my 2D text rendering using DirectX 11. I would need a truetype font that has correct kerning and valid other properties such as baseline, advance, scale, etc. I tried Arial on Windows, but I'm not sure if it's the version I have but I cannot get the kerning working. It would be great if there was a font that is guaranteed to have most properties and that they be valid. Any ideas on the best font to use for testing? Thanks!
  2. Thanks for the detailed answer. I added bilinear filtering and the blocky look is finally gone. I believe I was using less than 9 weights, probably more like 5 or 7, which makes sense as to why the edges would be narrow. The Intel article you linked looks very interesting and I'll go through it right away. That explains the darkened resulting texture. I will try that! I re-read the Rastertek tutorial this morning and they simply set the Alpha value of the pixel shader resulting color to 1.0f. This seems fine for their demo, but if I want to merge the blurred texture on my scene, should I simply leave the alpha as is at the exit of the shader? Sincere thanks for sharing your knowledge. You helped get me back on track and it is more appreciated than you think
  3. Hey MJP. I should have sent a picture, of course. The problem is when I scale the shape back up, as in this picture, the edges look very coarse. The left is a simple polygon, on the right is the same polygon, downscaled, blurred H + V then upscaled. Since you mentioned that this is the way to achieve the effect I want, I suspect I have something wrong with the code, maybe when I expand the smaller texture. I also wish the blurred border would be much larger to give a better effect. As it stands, it looks to be just a few pixels. I used an online kernal calculator to create the kernel values: 0.000229, 0.005977, 0.060598, 0.241732, 0.382928 Should I be setting a special filter in DX11 when I scale the texture back up?
  4. Hi all, I have been spending so much time trying to replicate a basic effect similar to these: Glowing line or Tron lines or More tron lines I've tried to use blurring using the shrink, horizontal and vertical passes, expand technique but the results of my implementation are crappy. I simply want my custom, non-textured 2d polygons to have a glow around them, in a size and color I can define. For example, I want to draw a blue rectangle using 2 triangles and have a glow around the shape. I am not sure how to best achieve this and what technique to use. I am prototyping an idea so performance is not an issue, I just want to get the pixels properly on the screen and I just can't figure out how to do it! It seems this effect has been done to death by now and should be easy, but I can't wrap my head around it, I'm not good at shaders at all I'm afraid. Are the Rastertek blur or glow tutorials the way to go? I'm using DirectX 11. Any tips or suggestions would be greatly appreciated!
  5. Many thanks for the link and information. I will read up and do tests on some different machine.   Much appreciated.
  6. I've been reading in a number of articles that using the discard statement in a pixel shader is a bad idea.    My question is this, if I already have an if() statement in my shader, will the addition of discard in the if block cause any slowdown? Or should I just set the alpha of that pixel to zero?   I'm using DX11 for displaying 2D graphics, so I do not do anything fancy and the shader I will be using the discard statement in will only be used to display text in a specific instance. My tests have shown no difference, but I'm afraid I might be missing something.   Thanks!
  7.   Probably you are measuring CPU time (time to prepare your commands). GPU timings are usually measured by GPU profilers such as NSight/DX GPU query/GPUView/..   Doh, very true! I'l give it a looksee.   Thanks guys. I got things working pretty fast now. If this becomes a problem, then I'll investigate.
  8. I just did some tests while I rewrote my text box parsing and rendering. This is on a Lenovo Ideapad Y560 laptop, which has a Radeon HD5730 video card.   Rendering a screen full of text at 1980x1080 (external monitor), 15750 total characters for 63000 vertices, using a single DrawIndexed call, with a simple pixel shader that does transparency.   The time to render the text varies between 2 and 4 microsecond. That is with no instancing and sending all those vertices to the gpu. I only update the buffer if the text changes in some way.   Strangely enough, if I render 200 characters, I get the same timing, 2 to 4 microseconds. This might be an innacuracy of the highperf counter, but I'm not sure. What I know is that its fast enough for my needs.
  9.   Great idea, I'll definitely do that.      Yeah, you're probably right. Besides, rendering the text in a texture would incur the rendering cost of parsing that text only once. It's probably cheaper to then just render the text texture until it's not needed anymore. I'll check that too.   @Ryan_001, thanks a lot for the link to that presentation. I found the video of that presentation on the GDC website: http://www.gdcvault.com/play/1020624/Advanced-Visual-Effects-with-DirectX along with many other great ones too! Very informative.   Thanks guys.     Yeah, you're probably right. Besides, rendering the text in a texture would incur the rendering cost of parsing that text only once. It's probably cheaper to then just render the text texture until it's not needed anymore. I'll check that too.   @Ryan_001, thanks a lot for the link to that presentation. I found the video of that presentation on the GDC website: http://www.gdcvault.com/play/1020624/Advanced-Visual-Effects-with-DirectX along with many other great ones too! Very informative.   In addition to the above advice, you're almost certainly not drawing enough text for it to be a bottleneck worth addressing.   Yeah, you're probably right. Besides, rendering the text in a texture would incur the rendering cost of parsing that text only once. It's probably cheaper to then just render the text texture until it's not needed anymore. I'll check that too.   @Ryan_001, thanks a lot for the link to that presentation. I found the video of that presentation on the GDC website: http://www.gdcvault.com/play/1020624/Advanced-Visual-Effects-with-DirectX along with many other great ones too! Very informative.  
  10. Hey guys,   I have a DX11 text rendering implementation where I have a bitmap with all the character glyphs that I use to build a list of quads with the position and UV of each glyph corresponding to the string I need to print. I then use one call to draw the text into a texture and can draw that texture wherever I need. Simple functions, simple shaders. I can also easily parse for special character, do linefeeds, limit the width for text boxes, change color, etc.   Today I sat down and decided to tackle the long overdue task of converting the rendering to use instancing, but it just hit me that it might not provide the great gains I previously thought it would. Most characters are of different sizes, so I would either have to handle resizing the geometry or maybe update the bitmap and then draw a fixed size quand and then reposition it based on the real width of the character. Or something else. This seems to break the K.I.S.S. principle.   Anyways, in the case where I do not issue more than 1 draw call to render the text, would there be any real benefits of using instancing to render text?   Thanks!
  11. Eric F.

    Alternatives for std::heap?

    Ah, indeed!   Thanks to you both. "Priority queue" lead me in the right direction and I now have it working. Now to test it and continue on my merry way!   :D
  12. Hi all,   I am currently converting the JPS pathfinding code from C++ to Delphi and the code I'm converting uses the std::heap to manage the open node list.   Now, I never used the heap before and I was wondering what structure in Delphi I could use in its place or if there was a heap class for Delphi anyone had already done.   My knowledge of the STD is kinda abysmal as I usually never need to use it in my daily work, so any help on this would be met with untold gratitudes ;)   Thanks!
  13. Hi all,   I was wondering if it is possible to create a HLSL shader to highlight objects like in baldur's gate or pillar of eternity, ie:     Or if this is done using a semi transparent texture on top of the object.   I'm not an expert with shaders, so I dont know if it is possible to detect edges like that.   Thanks for any help!  
  14. Hey all,   I was wondering if it was better to have my multiple smaller shaders, for example a shader for tiles without lighting, one for self-illumination, another for normal mapping and self-illumination, etc, or if it was fine to hale a larger one using IF/ELSE for different functionality.   I read that conditionals in shaders should be minimized due to their cost, but I wonder if it is better to hahe the IF/ELSE on the CPU side or if a few IFs will keep the shaders fast enough.   I'm only making a 2D tiled game.   Thanks for any input!
  • 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!