Tag Info

Hot answers tagged

3

So as a warning I'm quite rusty with regards to shaders, but lets take a look at the BasicEffect's source code and see how Microsoft did it. Overview of the shader pipeline. Most interesting bits below. For a fog shader BasicEffect utilizes the below 2 components. A vertex shader performs per-vertex processing such as transformations, skinning, vertex ...


2

Yes it is possible. And it is called texture. Textures are not just pictures - it can be any kind of data*. Another option would per-vertex data - if you dont mind smooth border between (un)explored. Or just as other post suggested - pass it as per-tile uniform. * Ofcourse, you need to stay in reasonable array size, defined by maximum texture size. ...


2

I'd simply provide a uniform per tile. For example a simple float that indicates the transparency. Before you render the tile, you simply set the uniform. If that's not possible, try using vertex attributes (also using a simple float).


2

Your code is only sampling the corner texels, so is only valid for a 2x2 filter. Sample all the texels within your filter shape to achieve correct results.


2

Super Sampling Super sampling and anti-aliasing are two different things. Super sampling is just rendering a frame at a higher resolution so that you have more information . This higher-resolution image is then down-sampled. This is especially useful when objects are very thin and might have been missed when sampling on a lower resolution. Down sampling ...


1

You just need to load the lighting value at the position of the pixel. // Example pixel shader DX11 float4 PixelShader(PixelLocation : SV_Position) : SV_Target0 { //... int3 SampleIndex = int3(PixelLocation.xy, 0); float4 lighting = LightingBuffer.Load(SampleIndex); //... } Info on Load here.


1

I think the problem is that your pixel shader returns a structure, so each element of that structure need to have an SV_TARGET semantic and not the whole struct, so: struct PS_OUTPUT { float4 PosWorld : SV_TARGET0; //changed sematic float4 NormalWorld : SV_TARGET1; //changed sematic }; PS_OUTPUT main(PS_INPUT input) ...


1

Answer: Added the vertexIDs in a second uv(set x value to the id) channel in the mesh(from my c# code), and then in the shader I could use the ids as I needed, example: void function(inout appdata_full v) { int vertexID = v.texcoord1[0]; ... }



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