Jump to content

  • Log In with Google      Sign In   
  • Create Account


hossainiir

Member Since 23 May 2010
Offline Last Active Sep 19 2014 12:07 PM

#5113675 Viable 3D text rendering solution for DirectX11

Posted by hossainiir on 02 December 2013 - 12:43 AM

I was searching to find a suitable method for rendering text in DX11.

http://rastertek.com/dx11tut12.html was best way but it has some limitations and extra works:

1-Creating Font atlas for an artist is a hard work.

2-This sample did not used some Dx11 ability such as Geometry Shader witch is very suitable to rendering font.

3-This sample implements text in screen space not in world space.

 

also I do not recommend that you use this method :

http://fw1.codeplex.com/

This lib create an extra device 9 or 10 to create DirectDraw thus it is a 2D font system and you can not use some debugging tools such as PIX and VS 2012 Diagnostics.




#5112917 Detect mouse pos on terrain!

Posted by hossainiir on 29 November 2013 - 02:57 AM

One simple way is using an extra Render Target that stores all tiles INDICES or IDS and when mouse clicked or moved over each tile then sample the render target witch Index or id has been picked.

In this method remember that Index or ID must pass as a pixel shader constant NOT as vertex shader constant and then pass to the pixel shader.

 

I'm using this method in Dx11 it works very nice also i'm using compute shader to pick ID and world space position of a pixel.

 

Excuse for bad English.




#5111253 PIX Crash

Posted by hossainiir on 22 November 2013 - 04:07 AM

Intel GPA is best choice for windows 8.


#5043893 How to build mesh position Matrix from COLLADA file?

Posted by hossainiir on 17 March 2013 - 12:48 AM

Hi,

try this : 

 

Matrix Trans = Matrix.Translation(5.463,0,-20);

Matrix RotX = Matrix.RotateX(DegreeToRadian(90.7396));

Matrix RotY = Matrix.RotateY(DegreeToRadian(0));

Matrix RotZ = Matrix.RotateZ(DegreeToRadian(0));

Matrix Scale = Matrix.Scaling(1,1,1);

 

TransformMatrix = Scale * RotX * RotY * RotZ * Trans;

 

This worked for me with XSI exporetd Collada.




#5013063 Directx painting in a picturebox/panel

Posted by hossainiir on 21 December 2012 - 03:37 AM

hi,

i am using the following codes in my programs:

in Program class :

    static class Program
    {
        static int Main()
        {
            var frm = new MainWindow();
            frm.Show();
            while (frm.Created)
            {
                frm.UpDate(0);
                frm.Render();
                Application.DoEvents();
            }
            return 0;
        }
    }

in MainWindow Class:

public partial class MainWindow : Form
{
    //RenderPanel is a Panel Control for Rendering the contents
    public IntPtr RenderPanelHandle { get { return RenderPanel.Handle; } }
    public MainWindow()
    {
        InitializeComponent();
    }
    public void UpDate(float dt)
    {
          //SomeCodes
    }
    public void Render()
    {
          //SomeCodes
    }
    //Others
}

the following code create a Device that render the contents in RenderPanel:

SlimDX.Direct3D9.Device d = new SlimDX.Direct3D9.Device(direct3D, 0, DeviceType.Hardware, RenderPanelHandle ,
                                                                    CreateFlags.MixedVertexProcessing, pp);



#5009375 Can't draw a simple cube

Posted by hossainiir on 11 December 2012 - 04:12 AM

before using Pix you must uncomment DrawPrimitives.
also i think is better to use DrawIndexedPrimitives and create IndexBuffer .

Pix is a good program for debugging Directx app.

1-run pix from directx sdk.
2-Create a new experiment and in program path enter app path or drag app and drop it to pix the experiment window will create with path.
3-select "A single-frame capture of ..." radio button and also set check "Enable draw timing" .
4-now press "start Experiment" by this work your app will start.
5-now press "F12" key and close your app.
6-after closing a window with name of Run will show that it has 4 sub windows.
7-in events window you in find "Frame #" which # is the number of frame that you captured!
8-find DrawPrimitives or DrawIndexedPrimitives and select it.
9-in details window select Mesh tab.
10-in this tab you can see wireframe of you model in 3 states 1:Pre-vertex Shader 2:Post-Vertex shader 3:View port.
11-in bottom we have two tabs PreVS and PostVS .
12-in PreVS you can see vertex data that you created.

try this.

excuse for bad english.


#5009013 Can't draw a simple cube

Posted by hossainiir on 10 December 2012 - 02:28 AM

Hi,
at first use PIX to capture a frame and see the vertex data is correct or not?


#4960558 passing a value from one class to another

Posted by hossainiir on 18 July 2012 - 11:27 AM

hi,
i think if u use a static varible,your problem will be solved.


#4808417 [MDX] Problem with AdvanceTime

Posted by hossainiir on 09 May 2011 - 01:19 AM

Posted Image
finally i solve the problem by my self , i'm wonder why no one answered me!!
i write the solution, maybe some one have same problem.
i used the following codes
AnimationController.AdvanceTime(elapsedTime, AnimCallback);AnimationController.AdvanceTime(0, AnimCallback);

this codes cause that callbacks trigger in right times but a big problem still remains.because of some unknown reason CallbackData become corrupt. i think that i have right times, current playing animation and current playing track , with having this informations i don't need CallBackData any more so i set them to null.



#4801933 loading a 3Dc (ATI1\ATI2) texture from file!

Posted by hossainiir on 23 April 2011 - 07:29 AM

ooh ,thanks alot rouncer!




#4801917 loading a 3Dc (ATI1\ATI2) texture from file!

Posted by hossainiir on 23 April 2011 - 06:19 AM

Yes it is.
in google i could not find any thing about how to loading this format from file.


#4801914 loading a 3Dc (ATI1\ATI2) texture from file!

Posted by hossainiir on 23 April 2011 - 06:11 AM

Really no one can help me???

Posted Image


#4801118 loading a 3Dc (ATI1\ATI2) texture from file!

Posted by hossainiir on 21 April 2011 - 12:21 AM

Anyone????
Posted Image


#4800912 loading a 3Dc (ATI1\ATI2) texture from file!

Posted by hossainiir on 20 April 2011 - 01:55 PM

hi,
how can i load a texture from file with 3Dc(ATI1\ATI2) format?
or what is wrong in the following codes?
C++
hr = D3DXCreateTextureFromFileEx(pd3dDevice,L"2.dds", 512,512,8,0, (D3DFORMAT)MAKEFOURCC('A','T','I','2'),D3DPOOL_MANAGED,0,0,0,0,0, &texture);

C# MDX
var tex = TextureLoader.FromFile(device, "2.dds", 512, 512, 8, 0, (Format)MakeFourCc('A', 'T', 'I', '2'), Pool.Default, Filter.Linear, Filter.Linear, 0);

the format of "2.dds" is ATI2.
for more information i can create texture with this format but i can not load this format from file!!

Thanks.


PARTNERS