5

Your code doesn't use your created texture with D3D11_CPU_ACCESS_READ. It creates a texture: // Create temp frame buffer(2d texture) wrl::ComPtr<ID3D11Texture2D>pFrame = nullptr; HRESULT hr = pDevice->CreateTexture2D(&pFrameDesc, nullptr, &pFrame); GFX_THROW_INFO(hr); Then it releases that texture and takes a reference to one from the ...


4

the higher the degree the more parameters you have to tweak. For example for a 100 point bezier curve there are 100 points to tweak and each point affects every part of the entire bezier curve, a piecewise curve lets you localize any tweaks you want to make. The higher degree the more intricate the calculations, degree 100 in a polynomial equation means you ...


3

In an ideal world, we wouldn't want them. We'd just use the same high quality textures far away and not care about wasted resources. Not really. If we forget about wasted resources and use fast enough machines, simple sampling of the textures, with e.g. bilinear filtering, will result in what is known as aliasing. In particular, this will look like noise in ...


2

I don't think you can make it with that generator alone, but you can use it as a starting point. It looks like the sparseness comes from adjusting the cutoff values - you just take regular noise, and make all pixels below certain gray level black, and all pixels above a different (higher) gray level white. Some noise generators will allow you to adjust this, ...


2

It's 100% not possible to shade a normal at all. As discussed in this link from the comments, the message was chosen to stop people from being able to research it, to tempt them into asking about it, and outing themselves as pirates. This was counting on players not knowing what a polygon normal actually was. :)


2

Following @DMGregory suggestion, I set the pixel shader as: float4 PS(PS_INPUT input, bool isFrontFace : SV_IsFrontFace) : SV_Target { float4 color = 0; if(isFrontFace) color = texWood.Sample(samLinear, input.Tex); else color = texRock.Sample(samLinear, input.Tex); return color * vMeshColor; } Then I got the intended result:...


2

From what I could gather over the internet, it appears that calls to functions that don't draw immediately like Now methods are removed from queue after scene was rendered. From one of the unity forums, part official response - "Another alternative could be using Graphics.DrawMesh (which does not draw mesh immediately, but "adds it into the scene&...


2

If I understand if you have P = A + uAB + vAC and you substract P on both sides then you get 0 = A + uAB + vAC - P and you change order 0 = A - P + uAB + vAC but A - P can mean vector PA 0 = PA + uAB + vAC


2

The documentation link you've provided is not from Direct3D 11, it's from Direct3D 9. That aside, in the code snippets and formulae around discussion of this matrix we see the following: Cx, Cy - dvClipX, dvClipY from D3DVIEWPORT9 Cw, Ch - dvClipWidth, dvClipHeight from D3DVIEWPORT9 Zmin, Zmax - dvMinZ, dvMaxZ from D3DVIEWPORT9 The mention of "from ...


2

In terms of game dev, what you've described sounds somewhat like multi-texturing: blending of multiple textures on the same surface. Texture splatting is a related idea, though it usually more concerned with blending textures in a seamless manner. With multi-texturing, usually the source textures are keyed to a particular color channel (red, blue, green and ...


1

Unreal has built in profiling tools to help you identify where the bottleneck is. Open the console and type stat unit and it will show you times in milliseconds for the CPU (both the game thread and the draw thread) and the GPU. See https://docs.unrealengine.com/4.27/en-US/TestingAndOptimization/PerformanceAndProfiling/StatCommands/#unit for details and a ...


1

When a pixel shader samples a texture (regardless of what kind of texture), it usually does so using the UV coordinates interpolated between the UV coordinates of the vertices of the polygon. The result is a pair of floating point values between 0 and 1. It then uses those coordinates to get the color value of the texture at that point, with 0:0 being the ...


1

Look up how Unity‘s FixedUpdate solves this: it’s a commonly used mechanism you might take inspiration from. FixedUpdate is called a fixed number of times per second; you decide how many by setting the fixedDeltaTime value in settings, which by default is 0.02s. Unity will always run this 50 times per second. Doing so any calculations inside the FixedUpdate ...


1

Chuck Walbourn's answer is correct, but to give you a bit more context, the texture you're creating with pDevice->CreateTexture2D is not the same as what you're getting with pSwapChain->GetBuffer. With pDevice->CreateTexture2D, you are creating a brand new on-memory texture (which is indeed set to be read from the CPU). The new texture is stored in ...


1

const GRID_HEIGHT = 10 const GRID_WIDTH = 10 const CELLSIZE = 32 const OUTLINE_COLOUR = 'green'; const FILL_COLOUR = 'red' const RAY_COLOUR = 'blue'; const X = 0; const Y = 1; const canvas = document.getElementById('demo'); const ctx = canvas.getContext('2d'); var mouseVector = new Vector2D([0, 0], [0, 0]); canvas.height = GRID_HEIGHT * CELLSIZE; canvas....


1

Thanks to @DMGregory for setting me on the right path. It appears you can't change the terrain shader, but you can change the terrain material. I solved this by changing the material from "Default-Terrain-Standard" to "Default-Terrain-Diffuse", which also had the side-effect of making the texture color appear closer to the color of the ...


1

why we can't just interpolate our z values to test if the point is behind or in front of the near plane? Because a vertex that's behind the near plane might be behind the camera entirely. That means the triangle crosses through a singularity in our projection, and part of it will be projected to the opposite quadrant of the screen from where we expect to ...


1

This line says your stackAngle is measured from 0 at z = +r to PI at z = -r: float z = r * cosf(stackAngle); But this line says your stackAngle goes from PI/2 (where z is 0) to -PI/2 (where z is 0 again): stackAngle = PI / 2 - i * stackStep; In between, stackAngle will pass over over 0 (where z = +r), but it will never visit +-PI (where z = -r). So you're ...


1

In the Mesh Renderer component you can select if that object will cast and receive shadows. So if there are some 3D objects that you don't want to have a shadow, just disable Shadow Casting and Shadow Receiving in the chosen model’s Mesh Renderer component. (I found that from here.) Additionally, you may want to increase the ambient lighting and decrease the ...


1

I refer to it as an index material since you're basically using each channel within an image as an index for masking out different things other than displaying an actual image.


1

A relatively fast algorithm in pseudocode: function fill_a_triangle(x1,y1,x2,y2,x3,y3) //get length of all sides d1 = sqrt(((y2-y1)**2)+((x2-x1)**2)) d2 = sqrt(((y3-y2)**2)+((x3-x2)**2)) d3 = sqrt(((y1-y3)**2)+((x1-x3)**2)) if(((d1<d2)or(d1=d2))and((d1<d2)or(d1=d2))) tx = x1 ty = y1 vx = (x2-x1)/d1 vy = (y2-y1)/d1 counter =...


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