Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Feb 2013
Offline Last Active Today, 01:41 AM

Topics I've Started

Clip 2D geometry by a virtual rectangle in HLSL

24 January 2016 - 10:45 AM

Hi all. I am developing GUI system and faced with an issue where I need a way to clip pixels in pixel shader for my controls by some virtual rectangle.


After googling a lot I didnt find answer on my question, so I decided to ask it here.


In attachment example of what I want to do.


Does anyone faced with the same problem and could say a way to implement that feature?

Draw dashed stroke around rectangle/ellipse with single draw call

12 January 2016 - 04:29 PM

Hi all,

I want to draw dashed/dotted stroke outside rectangle or ellipse using trinagle strip primitive topology with single draw call (in one vertex array),

but I faced with the issue that using triangle strip always add extra triangles, which fill gaps and spoil the stroke.

Like on the attached image. 


Is there a way to combine different vertex arrays using triangle strip and prohibit creating extra triangles to leave gaps betweem them?


Place message loop inside each window

25 December 2015 - 09:47 AM


I am trying to develop my own UI on C# based on native Win32 window and DX and faced with a common issue.

If I create a window in another thread, main message loop will no process messages for that window and it will freeze.

So, obvious solution is: place individual message loop inside each window to make sure that messages will reach each window.


But when I tried to implement that, I faced with another problem: window just freezes and not respond to any commands.


Does anyone know how to correctly place message loop inside each window that it work as expected?

I will appreciate for any samples taking into account the С# specific. Currently I am using p/Invoke for marshaling C++ functions.

Draw 2D empty and filled circle

28 November 2015 - 01:23 PM

I want to draw 2d circle using line list, which will look something like that, but without empty spaces to look like the solid border:




And also I want to draw filled circle usign triangle list or strip.


Does anyone could help me with algorithms for that?

Render GUI elements with projection matrix

23 November 2015 - 04:18 AM

I want to know how to render 3D objects at the same position on the screen with projection matrix.


I suppose I must use View matrix which has view direction strictly along Z axis, but what else?

I am asking because I want to draw GUI in 2D coordinates like usual UI 0,0 - is the upper left corner.


I know that OrthoOffCenterLH matrix can project 3d 0.0.0 to 2d 0.0 with left upper corner, but with ortho matrix there is no visible depth.

Thats why I want to use projection matrix.


I suppose that in this case I must manually calculate position of each element to move it from center in 3D to upper left corner in 2D. 


Am I right?