Tag Info

Hot answers tagged

4

Absolutely, But not as simple as taking a return value of a normal function. First I assume your question isn't about sharing variables between two shader stages (vertex, fragment..etc) but actually between two shader (programs). Shaders are part of the rendering pipeline, every input/output should pass through the rendering pipeline and its memory is ...


2

Depending on the texture, if you're changing the texture based on orthogonal connections, you'll only need 5 (if the texture can be rotated) or as many as 15. The simplest solution is to create these textures manually. You'll have a much easier time getting the visuals right. As for deciding which to use, see this question and answer: Choose tile based on ...


2

The D3DX 11 library has been discontinued so if you want to use it you will have to download the 2010 SDK and install it. (If paths are not already set up, you will have to set the library and include paths for your project to the folder where the SDK installs (somewhere in Program Files (x86) IIRC). However, if you want functionality similar to that of ...


2

Try doing this:- try { Robot bot = new Robot(); bot.keyPress(KeyEvent.VK_F6); bot.delay(50); bot.keyRelease(KeyEvent.VK_F6); } catch (AWTException ex) { Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex); }


2

What you essentially want is the depth in camera coordinates, but relative to model, not camera. the easiest way to achieve that is to calculate the position of the origin of a model coordinate system in camera coordinates. ... vec4 cs_position = glModelViewMatrix * gl_Vertex; vec4 origin_position = glModelViewMatrix * vec4(0,0,0,1); distToOrigin = ...


2

Although you don't strictly need to resize your depth/stencil buffer, you will need to do so if you want to use it in conjunction with the back buffer render target. This is because the depth/stencil buffer must match the size of the render target. If you are doing deferred rendering, or some other technique that doesn't require a depth buffer bound when ...


2

I'd expect the conversion to be more like: static XMVECTOR XMConvertToQuaternion(XMFLOAT3 axis, float radian) { return XMVectorSet(sin(radian/2)*axis.x, sin(radian/2)*axis.y, sin(radian/2)*axis.z, cos(radian/2)); } in particular there is no need to push the coordinates through a cos and the w should be the last coordinate, there is a micro optimization ...


1

Do I use XMMatrixRotationQuaternion(XMVECTOR quaternion) and multiply the resultant Matrix with my scaling matrix and translation matrix to get my transformation matrix? I believe so. At least that's what I do with D3D9. (D3DXMatrixRotationQuaternion) You might already know but multiplication order should be : scalingMatrix * rotationMatrix * ...


1

calculate a bounding volume of the object (sphere, convex hull, box - depends on your speed/accuracy needs), this needs to be done only once - at initalization while rendering, for each object: transform camera (origin, direction) to object space project bounding volume on camera direction axis and subtract camera origin projection to retrieve min/max ...


1

The easiest thing would be to create a gradient in Photoshop/Paint.NET/GIMP/whatever you use and blend that with your tile(s). If you want a more procedural approach, then take a look at Color.Lerp. A gradient with that method is simple. The first color parameter is the light shade, the second is the final dark shade and the progress is the row/column of ...


1

Yes, this is a fine approach - it will be orders of magnitude faster than creating a primitive per data point. Assuming single-channel data, you should use whatever DXGI_FORMAT (or equivalent in OGL) maps to your source data, and convert in the pixel shader. There are native types for 8, 16, and 32-bit integers, as well as 32-bit floats. You should also ...


1

When using the standard Sample method, the automatic MIP level selection is actually quite complex. Assuming standard tri-linear sampling of a 2D texture, two MIP levels are actually sampled. The hardware determines which ones by looking at the texture coordinate arguments of four adjacent pixel shader invocations (referred to as a "quad"), and calculates ...


1

There is a way to force a game to use WARP without disabling Display Driver, Just install the direct X SDK. http://www.microsoft.com/en-us/download/details.aspx?id=6812 Go to C:/windows/system32 Run dxcpl.exe In "Scope" click "Edit list" Add The Path To Your Application Go to your game / application directory And Launch It.



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