HLSL screen-space to world-space
I’m trying to use RenderDoc to understand how a DirectX11 game engine’s vertex shader works, and ultimately recover the world-space positions of vertices. I have captured a frame using RenderDoc, and...
View ArticleDX11 Losing Instance Buffer Data
I’ve got a function that basically creates different instance buffers into an array for me to use in my DrawIndexedInstanced call. But when I pass the vertex buffer and instance buffer through to my...
View ArticleVertex normals in the geometry shader using directx
I’m in directx 11 with the geometry shader. Is is possible to calculate vertex normals? Just one like segment per vertex? In the geometry shader? I did vertex normals per face, this is what I got, My...
View Article2D deferred lighting calculations not working
I have the following code for my HLSL pixel shader. Modified from another post here on GameDev (Link), but I have a few problems with it: // calculate UV and get texture and normal. float2 UV =...
View ArticleMonogame Vertex Shader Hassle
I’m currently creating a game in Monogame 3.4. I’ve written a relatively simple pixel shader in HLSL which works perfectly fine under Windows DX. When I use the same shader under Linux (OpenGL),...
View ArticleDistance per mesh in HLSL directx
I’m subdividing a sphere so when distance gets greater, the sphere is subdivided less to save memory. The sphere changes to another sphere when the distance is 10. My problem is that only one triangle...
View ArticleXNA Texture2D Copy Error
I have a static class that I use to build a 3d character and render the results to a RenderTarget2D which I then return. I’d like to store the results for later use so I need to make a copy of the...
View ArticleHLSL pixel inside a view (cascaded shadowmapping)
I’m figuring out shadowmapping in HLSL (see also this question). I understand that I need projection matrices for each cascading shadowmap. I use this code to create the projections: Matrix...
View ArticleParallax Occlusion Mapping using Shared Sampler
I’m using the Unreal Engine 4. So here is some custom node code that is supposed to achieve POM: while (i<MaxSteps+2) { texatray=dot(HeightMapChannel,...
View ArticleMultitexturing depending on given variables?
Im having trouble with rendering multiple textures. Using XNA gamestudio: working with 3D meshes and texturing. Effect.fx HLSL I do have a map/level that loads from a heightmap. – This works I have...
View Article