Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About kimchi325

  • Rank
  1. Tsus, you've provided exactly what I was looking for again! Thanks so much!
  2. In my application, I'm rendering many objects which have identical vertex/index buffers, so I figured instancing would be appropriate. I've found that this works fine for setting instance transformations et cetera, but I'd like to be able to potentially render each instance with a different set of textures. Is this possible?
  3. Ahhh, right, I should've known that. Thanks for the clarification.
  4. I think I've settled on a solution I like. I'm 'using BOOL = System.UInt32;' and using that type in my PixelShaderConstants structure. Thanks very much for the help guys, I really appreciate it.
  5. Hey guys, thanks very much for the responses. Here's what my constant buffer structure looks like: [StructLayout( LayoutKind.Sequential, Size = 48 )] struct PixelShaderConstants { public Color4 AmbientColor; public Vector3 LightDirection; public bool UseDiffuse; public bool UseNormal; public bool UseSpecular; } If I'm understanding this correctly, the problem is like you said in that these bools are 1byte and the HLSL bool is 4. Still though, I'm not sure how I can actually use a bool given that I'm doing this in C# and can't use the windows BOOL type. I tried System.Boolean thinking that that might be equivalent, but that didn't work. Using int's is a workable solution to my issue, but is that the only way to go? Or is there some way I'm missing that I can use a bool type for this in C#? Thanks again.
  6. I'm trying to add some options to a pixel shader I'm using. My constant buffer looks like: cbuffer PixelShaderConstants : register( b0 ) { float4 AmbientColor; float3 LightDirection; bool UseDiffuse; bool UseNormal; bool UseSpecular; } For some reason, the three bools at the end always come up false, even if I attempt to set them to true on the CPU side. The other variables in the constant buffer work fine. If I change the bools to floats, that works fine too -- I can't seem to figure out why I can't have a boolean in the constant buffer though. Any ideas what's going on? Thanks.
  7. This is exactly what I need. Thanks!
  8. I am in the process of creating an editor application where the user can load and place meshes et cetera. I'd want the user to be able to see a preview of a mesh before they place it, so I'd like to render meshes off screen and use the result as a preview image. What's the best way to approach something like that? Searching around I've seen some methods for capturing the whole screen and saving a bitmap, or accessing the device's front buffer data and so on (at least in D3D9), but these kinda seem like overkill for my case. Ideally, I don't ever need to save out anything actually -- I just want to generate these images in memory. Can anyone push me in the right direction? Thanks.
  9. Yay! Thanks again for the help, I officially have multiple views working in my project now.
  10. Oh shoot, I'm out of date. I'm still on March 2011. Thanks again man.
  11. Hey unbird, thanks for your reply. I am a little bit confused by your example. When you create the second SwapChain, it looks like device has a property called Factory that you pass as the first argument. In my case it seems that the device doesn't have such a property. Do you know what I might be missing there?
  12. Using your code instead of mine, I no longer get the error. Now I just have to figure out what I'm doing differently. Thanks so much for your help, I really appreciate it.
  13. I see that the constructor for SwapChain takes a Factory, a ComObject, and a SwapChainDescription. I can't seem to figure out what should be passed for these arguments. It seems that I can not pass my previously-created SlimDX.Direct3D11.Device as the ComObject, or use it's ComPointer. I've looked around but I can't seem to find an example of how to create more than one SwapChain. Everything I have tried results in D3DERR_INVALIDCALL. I want to do this so I can support rendering to multiple panels.
  14. I...think I just realized that I just use the Device constructor... I've got another question though. I read somewhere that I only need a single depth buffer and that I should just clear it before I render each view -- but won't that not work since the views will be of several different sizes?
  15. I'm working on an editor application and my goal is to create a general sort of render panel class, so that I can render to several different forms at the same time (and be opening new ones/closing old ones at run time). It seems like I should create the device first, and then create the swap chains later as I create the different forms that I will be rendering to. It looks like I have to create the first one at the same time I create the device though, which seems kind of awkward for my task, am I misunderstanding that? In case it's not completely obvious, I'm very new to DX in general. Any pointers are greatly appreciated. Thanks! ^^ (Also, are the SwapChain and the RenderTargetView the only things I need to maintain several of in this scenario?)
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!