Tag Info

New answers tagged

1

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.


0

If we look at the documentation, we see that a SamplerComparisonState is not a regular SamplerState: [in] SamplerComparisonState: A sampler-comparison state, which is the sampler state plus a comparison state (a comparison function and a comparison filter). Change your SamplerState creation code into a SamplerComparisonState. A good example (that seems ...


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


0

Off the top of my head, if these decals are drawn as discs, I would test each circle for intersection against each other circle, and put the intersection points into an array. Then draw arcs that are not inside an intersection. This is not a shader solution, though.


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


0

You could for example check in the decal rendering pixel shader if there is an intersection with any other decals and kill the pixel if so. It's quite efficient to do for this kind of circular decals.


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]; ... }


0

GuyRT is right. For some reason Ogre 1.9 + RenderSystemDX11 has problems generating the texture mipmap levels. I'm not sure the cause of this, but it is easily fixed by using Microsoft DirectX Texture Tool to generate the mip levels in the .dds


0

#define Iterations 254 float2 Pan; float Zoom; float Aspect; float4x4 MatrixTransform; void SpriteVertexShader(inout float4 color : COLOR0, inout float2 texCoord : TEXCOORD0, inout float4 position : SV_Position) { position = mul(position, MatrixTransform); } float4 Pixel_Shader(float2 texCoord : ...


2

Unfortunately, the toolkit doesn't support inline definition of sampler in the shader (as legacy fx does). In order to use a sampler, you need to: Simply declare a plain sampler state in hlsl: SamplerState MySampler; Pass a sampler state from C# available in GraphicsDevice.BlendStates (or create your own) and set it on the parameter ...


0

You can't use SV_Position for this in hlsl, you should get the position from an other output slot without the SV_Position semantic instead. output.mPosition = float4(output.mTexcoord * float2(2.0f, -2.0f) + float2(-1.0f, 1.0f), 0.0f, 1.0f); output.mNewPos = output.mPosition; //use mNewPos in the pixel shader SV_Position is just for the rasterizer.


0

I don't think you can directly, but you might consider writing a simple preprocessor and creating a custom build step.


1

Mono should behave the same way as .Net and the MSDN has this to say on preprocessor instructions ... When the C# compiler encounters an #if directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is defined. Unlike C and C++, you cannot assign a numeric value to a symbol; the #if ...


0

You can create a polygon that captures everywhere the light can reach. Drawing a light (with shadows) then only requires one draw call and no render target switches. The basic set-up is: Draw everything than can be lit For each light Compute the polygon of where the light can reach Draw the polygon using additive blending I've wrote a small ...


1

So the short answer is to turn on the debug layer. Thanks to @Nathan Reed for pointing that out. I tested it out and verified that it does indeed detect when shader signatures are incompatible. I also verified that new SV inputs to a shader stage must come last in the list of inputs.



Top 50 recent answers are included