Jump to content
  • Advertisement

NightcrawlerEX

Member
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

108 Neutral

About NightcrawlerEX

  • Rank
    Newbie
  1. I am using multiple calls to drawindexed for a single model to draw submeshes and some of the meshes have the same texture but different material stats etc. When i call settexture is there an internal check directx does to see if i am setting the same texture again or does it benefit me to check myself? E.g. For(submeshes) { Settexture() Otherstuff() Draw() } Compared to For(submeshes) { If(!textureissame) settexture() Otherstuff() Draw() }
  2. NightcrawlerEX

    Per face materials

    thanks, works great.
  3. NightcrawlerEX

    Per face materials

    Im using directx 10. Do i just loop and call ID3D10Device::DrawIndexed() for each index array? Is this efficient or is there a better way? Also the primative id semantic seems cool. Seems usefull for a number of effects
  4. NightcrawlerEX

    Per face materials

    Hi all, I have been looking through a directx x file exporter and have realised that it exports materials in a way different than i am used to. I am used to assigning a 1 material per object and when it comes to the shader, just passing in the material to be used. The way this exporter does it is by first outputting each material to be used, then outputting a set of per face indices to the relevant materials. I was wondering if anyone knew how to go about this, or possibly a link to some texts regarding this? Also is there a way to tell which face you are working on during the pixel shader? This would be good for many reasons but i dont think this is likely [EDIT] so far my train of though is sorting all the faces per material into seperate objects
  5. NightcrawlerEX

    My lowly triangle will not render :(

    oops... i posted the wrong answer i think    
  6.   Thanks, that was indeed my problem. All I had to do was create the rotation/scale matrix and apply it to all the vertices on export and also turn my indices for each triangle backward
  7. Hi all,   I have been working on a simple model exporter and have been having proplems with my UV coordinates.   When i exported from blender a textured cube the texture would not map properly. After a small search I realised that this was beacuse blender stores UV coordinates in relation to the the origin being at the bottom left and directx uses the top left. I then edited my exporter by changing... V = V   to   V = 1 - V   This sort of worked but it ended up with the textures being displayed backwards....   [attachment=13358:001.png]       I then started reading through a directx exporter I found that it used some code to turn triangles backward (vertindex = vertindex[::-1]) e.g. vert1 = 3  vert2 = 2 vert3 = 1   so I gave that a try to see how it affected everything and it yeilded this result...   [attachment=13359:002.png]   so I changed the rasterizer settings to cull the front of triangles and display the back...   [attachment=13360:003.png]   This worked! But I can't help feeling that this is the wrong way to do things.   Am I missing a more simple, less hacky way to do things here?   does it by chance have anything to do with the fact that blender uses different XYZ coordinates to directx [Blender] X = left/right Y = forward/back Z = up/down   [DirectX] X = left/right Y = up/down Z = foward/back     Any help would be greatly appreciated, I think it is something I am doing wrong beacuse anything I have read so far on this topic has ended with the answer simply being to invert the V coord. This does not work for me so I assume that I am doing something fundementally wrong   btw here is my texture...   [attachment=13361:004.png]
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!