Jump to content

  • Log In with Google      Sign In   
  • Create Account

Jason Z

Member Since 04 Feb 2004
Offline Last Active Jul 26 2016 04:26 PM

#5165925 Having a problem getting data from .obj file to render (index / Vertex buffer...

Posted by Jason Z on 09 July 2014 - 07:08 PM

Does your data look correct on the pre-VS tab for the vertices?  If so, then it may be an issue with your projection matrices, since your x values are squashed to zero.  I would guess that this is not the case though - I would bet that your data pre-VS is not correct, and that you have a data alignment issue in your vertex buffer.  Double check to make sure that the positions in your vertex buffer all match what is given in the OBJ file, and if they don't match then you probably have an alignment issue!

#5165541 How to use external variables in HLSL?

Posted by Jason Z on 08 July 2014 - 07:53 AM

@AvengerDR: That looks like an interesting approach (although you wrote much more C++ code than just writing the shader by hand :P ).  Do you have any further information about the system written up?

#5165027 Black smoke alpha settings

Posted by Jason Z on 06 July 2014 - 06:29 AM

I would use the same setup for any color of smoke - use billboards (which are just textured quads) and additively blend them together in a particle system that models the behavior of the smoke.  I normally use PNGs while developing, but you would likely want to switch to a processed format later on when you deploy your application.  That let's you load it faster into your application specific format.

#5164869 Wrote some simple SharpdDX tutorials, what do you think?

Posted by Jason Z on 05 July 2014 - 07:20 AM

I echo the call for D3D11 versions :)

#5164421 DirectX 11 Orbit Camera

Posted by Jason Z on 02 July 2014 - 04:46 PM

You can use your current view matrix functions, and just modify their input to an appropriate new model.  For example, if you want the camera view to rotate around an object, your look at point would be the center of the object.   Then the location for your 'look from' point can be calculated with spherical coordinates each frame.  This lets you easily increment the values of the spherical coordinates, which then get translated into a position.


Like Buckeye said, there are lots of ways to do it.  If you provide a little more detail about what you are currently using for your view matrix generation, we can probably give you a more specific answer.

#5164023 How to monitor video card memory

Posted by Jason Z on 01 July 2014 - 05:27 AM

I don't think it is possible to monitor all memory allocations and their locations for video memory.  On modern architectures the GPU memory is virtualized, meaning that more than one process will have GPU memory allocated at any given time (including Windows itself).  I believe the switch to DX10+ will help you in this situation, since DX9 was not a virtualized memory model. 


What you can do is to monitor your own memory allocations.  Anywhere that you allocate an object that resides in video memory, you can track it and keep a record of how much memory you have consumed.  Then this can be compared with the physical video memory of the system, which can be acquired through DXGI interfaces.


May I ask how you found out that the crash was caused by allocating too much memory? 

#5163734 Execute shader depending on what's visible on screen

Posted by Jason Z on 29 June 2014 - 05:52 PM

That's what I've meant. As soon as Hodgman has mentioned STALKER and raw D3D stuff being out of the picture, no soul seems to dare to reply unsure.png


I don't have any problem with the STALKER engine - I just don't know how to implement what you are asking without access to the API...  Is it really necessary to use the STALKER engine, or could you upgrade to something more open?

#5163733 Simulating lighting using volumetric meshes.

Posted by Jason Z on 29 June 2014 - 05:43 PM

I'm not sure about OpenGL, but in D3D11 you have to render to a slice of a 3D texture at a time.  If you want to fill the 3D texture will data, I would suggest using compute shaders rather than directly rendering...


Posted by Jason Z on 29 June 2014 - 05:40 PM

You can always create your vertex buffer as a structured buffer or byte address buffer, and then us SV_VertexID to manually unpack your data in the shader. However it's almost certainly not going to save you any performance.


It won't save performance for sure, but it opens lots of doors for you.  Indirect draw calls are much easier to do with a structured buffer as the data storage system for example.

#5163231 Vector Efficiency question

Posted by Jason Z on 27 June 2014 - 07:20 AM

If you are using a vector, you will get a contiguous block of memory used for your objects which may be helpful for cache performance and things like that.  If you want to find a particular entity, then I would suggest using an index into the vector instead of by string name.  You could easily create a helper function to convert to / from index and name, which will ease the process.


I wouldn't see any particular need to use a map in this case, since you don't need to really store the items by a unique ID or key.

#5163102 Direct3D 11 Swap-Chain Madness

Posted by Jason Z on 26 June 2014 - 03:41 PM

I wasn't aware that the Pro version was free - do you have a link showing where that is stated?  We have been using the express editions because of the licensing cost, but of course if the Pro SKU is available then I would upgrade to that.  I would be really surprised if that isn't a time limited demo for free, otherwise why would they even have the Express SKU???


So now you have the root cause of the issue, right?  So no further need for debugging there?

#5163090 Direct3D 11 Swap-Chain Madness

Posted by Jason Z on 26 June 2014 - 03:19 PM

I can’t use D3D11_CREATE_DEVICE_DEBUG without the Windows SDK 8 installed, something I fear doing considering apparently some things have to be done through Visual Studio 2012 (which I do not have).

L. Spiro


I guess I'm going off topic here, but I exclusively use VS2012 Express for Windows Desktop at work for my visualization tools.  Is there a substantive reason you don't want to upgrade?  My applications are targeting Windows 7+, so if you are using D3D11 then that should be ok for you too.


When I made the switch off of the DXSDK, it was essentially to remove my D3DX dependencies and find an alternative way to load textures.  If you are working in a cross platform engine, I would assume you have both of these topics covered already, so why not upgrade?  Each version of 2012 provides performance and bug fixes for the toolset and libraries, so there is a reason to upgrade.  Plus newer C++11/14 features are being added in each release which is also a nice bonus...

#5162667 Direct3D 11 Swap-Chain Madness

Posted by Jason Z on 24 June 2014 - 05:53 PM

I usually avoid all the craziness of the control panel by just creating the device with the debug flag - then you have no question whether it is enabled or not.

#5162419 Direct3D 11 Swap-Chain Madness

Posted by Jason Z on 23 June 2014 - 04:33 PM

This is just a crazy first shot, but is the exception handled somewhere other than your code?  I have had cases where the first chance exception occurs, only to be handled in one of the underlying libraries (i.e. the exception is used as a normal part of one of the sub-systems).  If you set VS to not break on first chance exceptions then you would never even know it occurred.


Before digging into the nitty gritty details, have you tried that out?

#5162209 Why does this matrix multiplication order matter?

Posted by Jason Z on 22 June 2014 - 07:31 PM



Again, GLSL does not make distinction betweeen column or row vectors in its very code, but order of operations is explicit of course (order is actualy equivalent of majoring).


The difference in the order is whether to multiply the vector first, and have all the other matrixes multiply a vector (reducing the number of operations since a vector is only 4x1), or multiply all the matrixes in order and only multiply the vector at the end.



That only saves operations if you are doing only one or two transformations.  If you are processing lots of vectors, then the matrix concatenation is clearly more efficient.


Regarding your original question, are you having issues with only one or two shaders, but all of the others are working as you expected (using the same matrix multiplication order)?