Tag Info

Hot answers tagged

10

Selecting the adapter with the highest available dedicated memory might work in a lot of cases, but in some cases a GPU with less processing power might have more dedicated memory, and your game will still run on the "wrong" adapter. This brings me to a counter-question, what is the right adapter? The one with the most computational power? The one with the ...


4

The D3DX function D3DXMatrixOrthoOffCenterRH constructs an orthographic projection matrix based on the top/left/right/bottom coordinates of the view volume. Per the documentation, the formula used is: 2/(r-l) 0 0 0 0 2/(t-b) 0 0 0 0 1/(zn-zf) 0 (l+r)/(l-r) (t+b)/(b-t) zn/(zn-zf) ...


2

Rather than use the legacy D3DXMath, consider using DirectXMath instead Plus you get all the source in the header. This computes the matrix as a row-major, right-handed matrix: inline XMMATRIX XMMatrixOrthographicOffCenterRH ( float ViewLeft, float ViewRight, float ViewBottom, float ViewTop, float NearZ, float FarZ ) { ...


2

If you are picking the adapter based on the one with the most memory, you may be having trouble accurately detecting the amount of memory used by Intel HD Graphics. Intel HD Graphics has access to two banks of memory; one dedicated and one shared with the CPU. The size of the two banks are reflected in the DXGI_ADAPTER_DESC structure as DedicatedVideoMemory ...


2

I would allow the player to choose which video card to use, i.e. through a drop down list in the options menu. You can use the GPU with the highest detected VRAM, clock speed, etc. as a sane default. You could go further and prompt the player to choose between "high performance" and "power saving" (chooses the lowest-spec card) for the default when the ...


2

Once upon a time there was Google. Now this seems to be what you are looking for: const char* SDL_GetCurrentVideoDriver(void) Returns the name of the current video driver or NULL if no driver has been initialized.


1

In SDL2 the creation of the window is separate from the rendering environment used to draw into that window. So, while you might pass "SDL_WINDOW_OPENGL" to SDL_CreateWindow(), this simply states that the window should support rendering from an OpenGL context later down the line and doesn't actually create an OpenGL context at that point. So, from ...


1

You just need to load the lighting value at the position of the pixel. // Example pixel shader DX11 float4 PixelShader(PixelLocation : SV_Position) : SV_Target0 { //... int3 SampleIndex = int3(PixelLocation.xy, 0); float4 lighting = LightingBuffer.Load(SampleIndex); //... } Info on Load here.


1

I think the problem is that your pixel shader returns a structure, so each element of that structure need to have an SV_TARGET semantic and not the whole struct, so: struct PS_OUTPUT { float4 PosWorld : SV_TARGET0; //changed sematic float4 NormalWorld : SV_TARGET1; //changed sematic }; PS_OUTPUT main(PS_INPUT input) ...


1

You've got quite a few problems here. First, the DeclarationUsage enumeration maps to D3DDECLUSAGE under the hood; these values are not flags, so or'ing them together doesn't make sense. When you create the vertex element array for a vertex declaration, each vertex attribute (position, color, et cetera) must be its own element. Thus, you should initialize ...


1

The desktop bounds, or 'WorkingArea' of the adapter can be found using the Screen(System.Windows.Forms.Screen) class. First you must have the handle of the device window(System.Windows.Forms.Form) displayed on the adapter. Then you can get the working area like this: // get the adapter monitor Screen adapterMonitor = Screen.FromHandle(GetForm().Handle); // ...



Only top voted, non community-wiki answers of a minimum length are eligible