New answers tagged

1

Of course, hours searching for clues, and few minutes after posting the question I find the answer :P Most similar way to do what I want to do is MaxLOD of D3D10_SAMPLER_DESC: https://msdn.microsoft.com/en-us/library/bb172415%28VS.85%29.aspx


1

Yes it does and they work the same way as in DX11


0

Matrix multiplication is not commutative. You need to do projection * view * model


2

"Intensity" of a color is often the purity of a hue in color theory. It's also known as saturation. This means you can compute the intensity (saturation) of a single color by converting it from the RGB space to the HSV space. The saturation component, specifically, can be computed by selecting the minimum and maximum color components Cmax = max(R, G, B); ...


6

I can't see anything fundamentally wrong with the shader, but here are a few things I find commonly done wrong with deferred shading that you might be doing. 1: Drawing full screen lights. The beauty of deferred shading is that you can pack your lights into geometry so that you only need to consider a part of the screen when drawing them (Like a cube with 2 ...


0

A classic solution is to use an arcball. Here's an example implementation using the SimpleMath wrapper for DirectXMath in the DirectX Tool Kit: class ArcBall { public: ArcBall() : m_width(800.f), m_height(400.f), m_radius(1.f), m_drag(false) { Reset(); } void Reset() { m_qdown = m_qnow = ...


2

The primary thing that stands out is that your loop copy initializes the auto val loop variable with the elements as you iterate. Even though your type is reasonably small, there's a bunch of overhead in doing so and it's likely that you would gain some by going for auto& val. Of secondary concern is that you're using strings for non-textual things. ...


2

A very short cutoff tk fhis problem, if you don't want to use trigonometry, is to first translate the view matrix with the distance between the camera and the player on the +z axis, then rozate the matrix, and after that, move it to the correct place, by translating it to the player's position. However, this is the worst and laziest solution I could think ...


0

HLSL in Direc3D 11 has a feature called Class Instances, in which you can dynamically plug in what functionality should be used in a particular draw call. You keep the implementation in the shader file and query out the location via reflection. The instances are specified as an array to your SetShader call. The MSDN page that outlines this is Instances and ...


0

I have solved this same problem (need to render the same geometry with simpler shaders for shadow mapping) in 2 ways: Wrap shader code sections into #IFDEF directives, so that on compile time I could enable or disable them, thus constructing 2 shaders from single source. (I mostly use it to enable-disable effects on-the-fly) Copy-paste the shader code and ...



Top 50 recent answers are included