Sign in to follow this  
MARS_999

DX11 A few questions about DX10 and other items

Recommended Posts

Well today GL died and DX won the battle most are saying now. So, I am now looking at maybe moving to DX10 or DX11, and I have heard that DX11 SDK will be out in Nov? Will the SDK run on DX10/10.1 hardware accelerated or in software mode? If I move to DX should I wait till DX11 comes out? Is DX10 coding going to carry over into DX11, or will DX11 be a complete overhaul like 9 to 10 was? What about a GUI library for DX10? What about Physx libs? I want something that is native to DX10, basically drop in and play? What about model loading or rendering? Does DX10 have a decent model loader like .x files under DX10? Is the DXUT or math libs still in DX10? I need some of these questions answered so I can make my decision soon, and what about ATI/Nvidia drivers for DX10 are all the features included as of now on both? Meaning if I code DX10 will it run on both without a headache? Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by MARS_999So, I am now looking at maybe moving to DX10 or DX11, and I have heard that DX11 SDK will be out in Nov? Will the SDK run on DX10/10.1 hardware accelerated or in software mode?


A techpreview will be out in November. Since D3D10 it has become a tradition to show the developers a techpreview first. While it will be mostly complete some minor changes can still happen. Direct3D 11 will run with Direct3D 10/10.1 in hardware mode you just can't use the new D3D11 features like the compute shaders.

Quote:
Original post by MARS_999If I move to DX should I wait till DX11 comes out? Is DX10 coding going to carry over into DX11, or will DX11 be a complete overhaul like 9 to 10 was?


It will be mostly the same. Porting from 10 to 11 should be just a matter of some hours. Most of this could be done with a simple find/replace.

Quote:
Original post by MARS_999What about a GUI library for DX10? What about Physx libs? I want something that is native to DX10, basically drop in and play?


I am not aware of a GUI lib but I am never actively searched for any as we use our own. I am not sure where you see problem with PhysX. The PhysX SDK may not contain a sample for Direct3D 10 but it is mostly the same workflow as with Direct3D 9

Quote:
Original post by MARS_999What about model loading or rendering? Does DX10 have a decent model loader like .x files under DX10?


X Files are considered as dead. They have some loader code for their new SDK asset format. But in general writing an asset loader is very straight forward.

Quote:
Original post by MARS_999Is the DXUT or math libs still in DX10?


Yes the DXUT is still part of the SDK and D3DX contains still the math libraries.

Quote:
Original post by MARS_999I need some of these questions answered so I can make my decision soon, and what about ATI/Nvidia drivers for DX10 are all the features included as of now on both? Meaning if I code DX10 will it run on both without a headache?


Direct3D 10 requires that the hardware and the driver support the full techlevel. There are only some optional features left. In our case we run the exact same code on every Direct3D 10 hardware.

Share this post


Link to post
Share on other sites
Im still using DX9 and I think ill continue to use it until XP totally dies out then I'll move to the most widespread supported api.
Currently DX9 is more than enough for what I'm doing.

Share this post


Link to post
Share on other sites
Quote:
Well today GL died
I briefly discussed OpenGL with Rob at GameFest last week and he mentioned there was an announcement due that week. I'm a bit out of the loop - what came up and why do you declare GL dead?

Ralf's covered your questions, but just to throw my 2-pence in... Go with D3D 10.0 and be happy, it can be stated that simply.

The only case I'd suggest you hold off for D3D11 is if you want to go for a massively parallel architecture or want to port some old X360 native code over. The architectural changes with 11 allow for a very different design that can be quite tricky to implement on 10.x and older API's. The stuff for free-threaded resource creation and immediate/deferred display lists is powerful.

As an aside, I was also discussing with Rob and Richard last week about my thoughts that traditional frame-based designs will be rapidly going the way of the dodo in this multi-threaded world. But thats a whole other discussion [grin]

Quote:
Does DX10 have a decent model loader like .x files under DX10?
There are ID3DX10Mesh objects that map reasonably well to legacy formats but there is no .X support nor any mesh manipulation functions. However you can still do all your mesh work with D3DX9 and a NULLREF device then just copy the ID3DXMesh to a ID3DX10Mesh for rendering. I've posted the code for this a few times but its not too hard to figure out for yourself [wink]

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Well today GL died
I briefly discussed OpenGL with Rob at GameFest last week and he mentioned there was an announcement due that week. I'm a bit out of the loop - what came up and why do you declare GL dead?
Ok, I shouldn't be so lazy!

Interesting thread to read and Oluseyi's comments about GL having other huge markets to cater for is a good one. Leading the GL community on was bad form, but maybe games just aren't that important to them when compared with multi-billion dollar CAD industries...?

Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Original post by jollyjeffers
Quote:
Well today GL died
I briefly discussed OpenGL with Rob at GameFest last week and he mentioned there was an announcement due that week. I'm a bit out of the loop - what came up and why do you declare GL dead?
Ok, I shouldn't be so lazy!

Interesting thread to read and Oluseyi's comments about GL having other huge markets to cater for is a good one. Leading the GL community on was bad form, but maybe games just aren't that important to them when compared with multi-billion dollar CAD industries...?

Jack


Hi Jack, the multi-billion dollar industry is fine, but games as a whole is many many times larger than they are, if everyone used GL vs. DX for games CAD would be a very small part as a whole. GL probably isn't dead, but sure feels like it when most people are talking about leaving it...

What are you saying about DX11? Will DX11 be different to code for than Dx10?

Share this post


Link to post
Share on other sites
Quote:
Original post by MARS_999
Hi Jack, the multi-billion dollar industry is fine, but games as a whole is many many times larger than they are, if everyone used GL vs. DX for games CAD would be a very small part as a whole. GL probably isn't dead, but sure feels like it when most people are talking about leaving it...
I'm not well versed on the size (customers/companies/revenue) of the CAD and dependent industries so I don't know how it compares. I was just commenting that Oluseyi seemed to have raised a good point that one distinct interpretation of this is that the ARB/Khronos group bent to keep certain camp(s) happy and that gaming may well not have been their interest.

Quote:
Original post by MARS_999
What are you saying about DX11? Will DX11 be different to code for than Dx10?
As Ralf commented the actual code changes for D3D11 are pretty reasonable from a 10.0/10.1 perspective and if you're familiar with 10 you'll be fine with 11.

What I was getting at is the architectural possibilities. A big part of the D3D11 design is to better support multi-threading, something that isn't such a great story under D3D10 or D3D9.

Designing a "traditonal" D3D9/D3D10 renderer and then porting it up to D3D11 is perfectly fine. But if you were to go straight for D3D11 (which can support down-level hardware) then you have more options w.r.t. the design and architecture of your code - you can do more interesting and more powerful things with multi-threading.

If you want to get rolling straight away then stick with the traditional approach and go for D3D10. I would imagine you need to be at the bleeding edge with a pretty large and complex engine (inc. non graphics parts) to really see any ROI on a massively multi-threaded next-gen engine right now [smile]

hth
Jack

Share this post


Link to post
Share on other sites
One last question, maybe Jack can answer it, with DX11 they are talking about Multi-core CPUs being utilized better, so what do they mean by this? Would I be better off with a quad core vs. a dual core for DX11? Thanks

Share this post


Link to post
Share on other sites
This depends on your software. The multi core support for Direct3D 11 is not a feature that works automatic without special code. Direct3D 11 allows you to fill multiple “display list” at the same time on different threads. Finely you can send all this lists in the right order to the GPU for rendering. The advantage by doing this is that most CPU work will be already done by the threads that fill the display list.

If your software can fill four list parallel you can be faster with a quad core. But you need to be CPU limited and not GPU limited.

Share this post


Link to post
Share on other sites
Right now, with D3D9 and 10, there is very limited support for mutlithreading and doing things like resource creation or issuing drawing commands.

You pretty much have two choices;
1) don't do it. All drawing and resource creation/uploads take place in the main rendering thread the device was created in (like how a GL context is dealt with), just using other threads to decompress the data.

2) create a multi-threaded device which lets you do things from multiple threads at once but involves all manner of criticalsection locks which hurt performance.

With DX11 the landscape changes in that you'll be able to create resources from any thread and there are 'deferred' contexts which are used for constructing display lists which can then be executed from the main context.

Jack, Superpig and myself go into various levels of detail about this in our XNA Gamefest write ups in the journal section.

As for performance, it's less about DX11 and your cores and more about how the games as a whole are designed, DX11 just removes the cluggyness from dealing with multithreading.

Share this post


Link to post
Share on other sites
So it is possible that if the games are designed correctly that with a quad core you could get some decent speed increases over a dual core, if I am understanding you correctly. But on the same token, the current crop of games aren't designed to well to work with quad cores, and maybe the next round of games or when the next console generation comes out, we will have better designed engines, that could in theory take and use a quad core system to it fullest potential... So for now I would be better off with a faster dual core rig, 3.33Ghz dual vs. a 2.83Ghz quad core? Reason I am asking is I am building a new rig soon, and can't decide between dual or quad and my problem is I upgrade every 12-18 months, and I am trying to get away from that and keep a rig for 2-3 years for once! ;)

Share this post


Link to post
Share on other sites
Even now a game could see significant gains over dual core if designed in such a way as to take advantage of the extra cores.

DX11 just makes submitting data and streaming resources that much easier than before; granted, if you have secondary threads setting up display lists it could very well give you a boost but at the end of the day it all comes down to bottlenecks; if pixel rate is a bottle neck then throwing all the CPU resources in teh world at the problem won't increase the speed.

I've had my X2 2.2Ghz for the last 3years now, about the only thing i've upgraded has been the GPU because games outpace the GPU more than the CPU. However, if you are wanting to build a new rig I'd suggest holding off for a few months for Core i7's release as even if you don't get one it might well drop the price of the current Duo and Quad processors a little.
(my plans are to build a new machine around March next year, DoW2 has the power to adjust that build time however, closer or further away)

Share this post


Link to post
Share on other sites
So, whats going to be the standard in regards to models? What's the best format to be used in DX10+? I've used X files for some time, does DX10+ have a newer loader for any model types? 3ds? etc?

Thanks for any answers.

Share this post


Link to post
Share on other sites
Quote:
Original post by QuinnJohns
So, whats going to be the standard in regards to models? What's the best format to be used in DX10+? I've used X files for some time, does DX10+ have a newer loader for any model types? 3ds? etc?

Thanks for any answers.


No. If you're not going to use X files, you're pretty much on your own. If you have a well-designed engine, writing model loaders is not hard really.

Share this post


Link to post
Share on other sites
Thanks, Phantom for the tip, so it looks like you are leaning towards a Quad core yourself, next build?

I thought about the i7, but problem is drivers, bugs, BIOS updates are going to be abundant at first and BSOD aren't in my best interest right now while working on my game. I want stable. Plus 32nm is coming in 2010, and I think I would rather have that version of i7, than the first rev, due to any bugs and possible more SSE extensions will be added by then... Not to mention the cost of i7 with DDR3 RAM and a X58 MB we are talking 400-500 above the cost of a 45nm Quad now with a P45 chipset. I pretty much have decided it will be a quad core probably 2.83ghz, next issue is GPU, I am not excited with the current latest generation GPUS, both run HOT, I would rather get a GF8800 GTS and wait till DX11 cards are out, and or Larrabee to see whats what, no sense in throwing away a few extra hundred dollars for nothing.

;)

Share this post


Link to post
Share on other sites
The 32nm will be a pin-compatible die strink so even if you did get a 45nm now the 32nm will work with the same equipment; I also don't see the 32nm going for faster than DDR3 ram either as that would require the memory controller to be updated, so that's a safe investment. SSE extensions are all well and good but unless you are planning to make a game only for that hardware you have to take into account everything else as well anyway; based on what I've read only some encryption functions are likely to be added.

Or to put all this another way; right now you are considering dropping a few 100 USD on a system you plan to upgrade in just over a year which was precisisely the situation you were trying to get out of as I recall [smile]

Share this post


Link to post
Share on other sites
Last system I had for 18 months, was a CD2 2.4Ghz, 6GB, 975X MB, 8800GTS 640MB, I sold that, and decided that I wanted to upgrade to quad, but you make a decent point, with the pin compatible 32nm from the 45nm Core i7. If you are sure of this? Plus DDR3 1333mhz will be the choice from what I hear, and if you can keep that with the X58MB I guess it would be just a CPU upgrade in 18-24 months to give it another speed boost. I think I will do that, and just maybe Nvidia will have their 55nm G200 series cards out by Oct also, and if not maybe ATI will have GL3 drivers and I can get an ATI card...

Share this post


Link to post
Share on other sites
I'm in the process of building a Q6600 Quad-Core Core2 box. I looked at the cutting edge stuff and that on the horizon but the Q6600 seems to have been well and truly tested by the enthusiast community and seems incredibly popular - figured that was a good trade off between fast (but not necessarily super fast) and stable [grin]


Anyway, on topic with D3D10/11... I've postulated that the "frame by frame" architecture of current games is probably going the way of the dodo. With a task-based multi-threaded architecture it's likely that all the overlapping and concurrent model updates are going to completely blur the line of what is/isn't in a given frame.

But the key thing there, and has also been commented in this thread is that it isn't a free lunch and doesn't just automagically happen. Developers have to start designing and writing their code for it.


cheers,
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
I'm in the process of building a Q6600 Quad-Core Core2 box. I looked at the cutting edge stuff and that on the horizon but the Q6600 seems to have been well and truly tested by the enthusiast community and seems incredibly popular - figured that was a good trade off between fast (but not necessarily super fast) and stable [grin]


Anyway, on topic with D3D10/11... I've postulated that the "frame by frame" architecture of current games is probably going the way of the dodo. With a task-based multi-threaded architecture it's likely that all the overlapping and concurrent model updates are going to completely blur the line of what is/isn't in a given frame.

But the key thing there, and has also been commented in this thread is that it isn't a free lunch and doesn't just automagically happen. Developers have to start designing and writing their code for it.


cheers,
Jack


Yes, I have heard the Q6600 is a nice CPU. I doubt you are going to overclock it, but if you did you can hit 3+Ghz easily I hear. I don't overclock. Anyway about the frame by frame idea, how is that going to work for stuff like physics, or shadowmapping passes, and other methods I haven't even thought of yet. Is the new model going to be based off time slices? Meaning you have so much time to do what you need to do and then you updated the buffer? This is all new to me. But then again, for the distance future frame by frame is going to be ok for small indie guys right?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      627700
    • Total Posts
      2978695
  • Similar Content

    • By Baemz
      Hello,
      I've been working on some culling-techniques for a project. We've built our own engine so pretty much everything is built from scratch. I've set up a frustum with the following code, assuming that the FOV is 90 degrees.
      float angle = CU::ToRadians(45.f); Plane<float> nearPlane(Vector3<float>(0, 0, aNear), Vector3<float>(0, 0, -1)); Plane<float> farPlane(Vector3<float>(0, 0, aFar), Vector3<float>(0, 0, 1)); Plane<float> right(Vector3<float>(0, 0, 0), Vector3<float>(angle, 0, -angle)); Plane<float> left(Vector3<float>(0, 0, 0), Vector3<float>(-angle, 0, -angle)); Plane<float> up(Vector3<float>(0, 0, 0), Vector3<float>(0, angle, -angle)); Plane<float> down(Vector3<float>(0, 0, 0), Vector3<float>(0, -angle, -angle)); myVolume.AddPlane(nearPlane); myVolume.AddPlane(farPlane); myVolume.AddPlane(right); myVolume.AddPlane(left); myVolume.AddPlane(up); myVolume.AddPlane(down); When checking the intersections I am using a BoundingSphere of my models, which is calculated by taking the average position of all vertices and then choosing the furthest distance to a vertex for radius. The actual intersection test looks like this, where the "myFrustum90" is the actual frustum described above.
      The orientationInverse is actually the viewMatrix-inverse in this case.
      bool CFrustum::Intersects(const SFrustumCollider& aCollider) { CU::Vector4<float> position = CU::Vector4<float>(aCollider.myCenter.x, aCollider.myCenter.y, aCollider.myCenter.z, 1.f) * myOrientationInverse; return myFrustum90.Inside({ position.x, position.y, position.z }, aCollider.myRadius); } The Inside() function looks like this.
      template <typename T> bool PlaneVolume<T>::Inside(Vector3<T> aPosition, T aRadius) const { for (unsigned short i = 0; i < myPlaneList.size(); ++i) { if (myPlaneList[i].ClassifySpherePlane(aPosition, aRadius) > 0) { return false; } } return true; } And this is the ClassifySpherePlane() function. (The plane is defined as a Vector4 called myABCD, where ABC is the normal)
      template <typename T> inline int Plane<T>::ClassifySpherePlane(Vector3<T> aSpherePosition, float aSphereRadius) const { float distance = (aSpherePosition.Dot(myNormal)) - myABCD.w; // completely on the front side if (distance >= aSphereRadius) { return 1; } // completely on the backside (aka "inside") if (distance <= -aSphereRadius) { return -1; } //sphere intersects the plane return 0; }  
      Please bare in mind that this code is not optimized nor well-written by any means. I am just looking to get it working.
      The result of this culling is that the models seem to be culled a bit "too early", so that the culling is visible and the models pops away.
      How do I get the culling to work properly?
      I have tried different techniques but haven't gotten any of them to work.
      If you need more code or explanations feel free to ask for it.

      Thanks.
       
    • By evelyn4you
      hi,
      i have read very much about the binding of a constantbuffer to a shader but something is still unclear to me.
      e.g. when performing :   vertexshader.setConstantbuffer ( buffer,  slot )
       is the buffer bound
      a.  to the VertexShaderStage
      or
      b. to the VertexShader that is currently set as the active VertexShader
      Is it possible to bind a constantBuffer to a VertexShader e.g. VS_A and keep this binding even after the active VertexShader has changed ?
      I mean i want to bind constantbuffer_A  to VS_A, an Constantbuffer_B to VS_B  and  only use updateSubresource without using setConstantBuffer command every time.

      Look at this example:
      SetVertexShader ( VS_A )
      updateSubresource(buffer_A)
      vertexshader.setConstantbuffer ( buffer_A,  slot_A )
      perform drawcall       ( buffer_A is used )

      SetVertexShader ( VS_B )
      updateSubresource(buffer_B)
      vertexshader.setConstantbuffer ( buffer_B,  slot_A )
      perform drawcall   ( buffer_B is used )
      SetVertexShader ( VS_A )
      perform drawcall   (now which buffer is used ??? )
       
      I ask this question because i have made a custom render engine an want to optimize to
      the minimum  updateSubresource, and setConstantbuffer  calls
       
       
       
       
       
    • By noodleBowl
      I got a quick question about buffers when it comes to DirectX 11. If I bind a buffer using a command like:
      IASetVertexBuffers IASetIndexBuffer VSSetConstantBuffers PSSetConstantBuffers  and then later on I update that bound buffer's data using commands like Map/Unmap or any of the other update commands.
      Do I need to rebind the buffer again in order for my update to take effect? If I dont rebind is that really bad as in I get a performance hit? My thought process behind this is that if the buffer is already bound why do I need to rebind it? I'm using that same buffer it is just different data
       
    • By Rockmover
      I am really stuck with something that should be very simple in DirectX 11. 
      1. I can draw lines using a PC (position, colored) vertices and a simple shader just fine.
      2. I can draw 3D triangles using PCN (position, colored, normal) vertices just fine (even transparency and SpecularBlinnPhong shaders).
       
      However, if I'm using my 3D shader, and I want to draw my PC lines in the same scene how can I do that?
       
      If I change my lines to PCN and pass them to the 3D shader with my triangles, then the lighting screws them all up.  I only want the lighting for the 3D triangles, but no SpecularBlinnPhong/Lighting for the lines (just PC). 
      I am sure this is because if I change the lines to PNC there is not really a correct "normal" for the lines.  
      I assume I somehow need to draw the 3D triangles using one shader, and then "switch" to another shader and draw the lines?  But I have no clue how to use two different shaders in the same scene.  And then are the lines just drawn on top of the triangles, or vice versa (maybe draw order dependent)?  
      I must be missing something really basic, so if anyone can just point me in the right direction (or link to an example showing the implementation of multiple shaders) that would be REALLY appreciated.
       
      I'm also more than happy to post my simple test code if that helps as well!
       
      THANKS SO MUCH IN ADVANCE!!!
    • By Reitano
      Hi,
      I am writing a linear allocator of per-frame constants using the DirectX 11.1 API. My plan is to replace the traditional constant allocation strategy, where most of the work is done by the driver behind my back, with a manual one inspired by the DirectX 12 and Vulkan APIs.
      In brief, the allocator maintains a list of 64K pages, each page owns a constant buffer managed as a ring buffer. Each page has a history of the N previous frames. At the beginning of a new frame, the allocator retires the frames that have been processed by the GPU and frees up the corresponding space in each page. I use DirectX 11 queries for detecting when a frame is complete and the ID3D11DeviceContext1::VS/PSSetConstantBuffers1 methods for binding constant buffers with an offset.
      The new allocator appears to be working but I am not 100% confident it is actually correct. In particular:
      1) it relies on queries which I am not too familiar with. Are they 100% reliable ?
      2) it maps/unmaps the constant buffer of each page at the beginning of a new frame and then writes the mapped memory as the frame is built. In pseudo code:
      BeginFrame:
          page.data = device.Map(page.buffer)
          device.Unmap(page.buffer)
      RenderFrame
          Alloc(size, initData)
              ...
              memcpy(page.data + page.start, initData, size)
          Alloc(size, initData)
              ...
              memcpy(page.data + page.start, initData, size)
      (Note: calling Unmap at the end of a frame prevents binding the mapped constant buffers and triggers an error in the debug layer)
      Is this valid ? 
      3) I don't fully understand how many frames I should keep in the history. My intuition says it should be equal to the maximum latency reported by IDXGIDevice1::GetMaximumFrameLatency, which is 3 on my machine. But, this value works fine in an unit test while on a more complex demo I need to manually set it to 5, otherwise the allocator starts overwriting previous frames that have not completed yet. Shouldn't the swap chain Present method block the CPU in this case ?
      4) Should I expect this approach to be more efficient than the one managed by the driver ? I don't have meaningful profile data yet.
      Is anybody familiar with the approach described above and can answer my questions and discuss the pros and cons of this technique based on his experience ? 
      For reference, I've uploaded the (WIP) allocator code at https://paste.ofcode.org/Bq98ujP6zaAuKyjv4X7HSv.  Feel free to adapt it in your engine and please let me know if you spot any mistakes
      Thanks
      Stefano Lanza
       
  • Popular Now