New answers tagged

0

Try changing your assignment to debug[id.xyz] = 1;


0

I found that rendering dynamic Entity-textures in XNA such as cubes or "planes" needs alot of HLSL knowledge, how to throw in shaders and more. I scrapped my XNA project and started with Java OpenGL "LWJGL". ThinMatrix had a good tutorial series with a quick runtrough of the glsl shader system. with "dynamic" I meant rendering and changing the ...


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 ...


3

First Question: The dot product basically tells you how much two vectors are pointing in the same direction. So if a light points directly against the normal of a surface the surface will be brighter than if it points at it in an angled way or away from it. If you are struggling with getting this to work, I would advise very heavily against trying to ...


0

So basically you are looking to paint your environment as it is shot? Apply 2 textures to your object, the main texture being pure black, the secondary being the actual coloured texture. Grab the point on the object that the mesh was struck Convert this point into the x,y coordinate on the texture itself Grab the pixel (and maybe surrounding pixels) and ...


0

Computing vertex normals is a complex process as you need to have all incident faces available, and the ability to "split verts" when needed. This is not really something well suited to the Geometry Shader. Face normals do fit well with Geometry Shader because you only care about the primitive itself. Is there some reason you have to do this on the GPU? ...


2

There are different ways to do this. 1. Tessellation Do this with tessellation. That is exactly what tessellation was created for. You have to read a bit about it, but when you got it, thinks are going much easier. 2. Structured Buffer Instead of using the normal pipeline, you can bind the triangle mesh (vertices) as a structured buffer. Then you can ...


2

Although you can use the geometry shader to sub-divide primitives, I would suggest looking into tessellation. It is a new feature that has been added in DirectX 11, which allows you to sub-divide low level primitives into high-detailed primitives. This feature is highly optimized to do the exact thing you are describing. See the image below for an example. ...



Top 50 recent answers are included