none
c# sharpDX how normal mapping done ? RRS feed

  • Question

  • Hello I am using sharpdx. I want to add normal map to my model. Example I have crate.png then I want to put crate_normal.png

    I set the diffuse texture like:

     var myTextureData= TextureLoader.CreateTexture2DFromBitmap(device, TextureLoader.LoadBitmap(imagingFactory2, "crate.png")); 
    
    ShaderResourceView textureView = new ShaderResourceView(device, myTextureData);
    
    ....
    
    Render(... ){
    ... 
    device.ImmediateContext.PixelShader.SetShaderResource(0, textureView);
    ...
    }

    How will I put the normal texture in this will I create array of textureData that holds textures[]=> "crate.png, crate_normal.png" ?

    Then they say about binormals tangents normal I did not understand the calculation how should I do it of cource in C#

    I use FBX assimp library and that has those options :

    mesh.BiTangents
    mesh.Tangents
    mesh.Normals

    What should I do with those and what is the relationship with texture ?

    Sunday, October 8, 2017 2:56 PM

All replies

  • Hi gomili,

    According to your question is more related to thirdparty lib, you could post a new thread to SharpDx Forum for suitable support.There are a lot of experience people to help your walk out the issues quickly.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools . If you have some grammar or code errors, please feel free to contact us.We will try our best to give you a solution.

    Sincerely,

    neil hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 9, 2017 8:48 AM
  • Thanks for the anwser, indeed this is related to HLSL language which is all same regardless to the 3rd party content (hlsl comes from a simple text file) is there a any place that I can ask High level shading language questions ?
    Wednesday, December 20, 2017 10:29 AM