Jump to content
  • Advertisement

johnmortal

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

100 Neutral

About johnmortal

  • Rank
    Newbie
  1. Never did figure out why this was happening, but by using a shader constructed on by the C++ code and the using PSSetSamplers I got it to do point sampling. If anyone knows why it wouldn't work the way it was, feel free to comment. The problem may well lie with the line Filter = MIN_MAG_MIP_POINT; of the above file because I could put Filter = ANYTHING_I_WANT_TO_TYPE; and get exactly the same result.
  2. My texture is clearly being magnified using linear sampling instead of point sampling, despite the fact that in my effects file I specify that a point sampler should be used.. . The texture is a 4096x4096 image generated programmatically. The pixel shader and vertex shader are compiled as seperate shaders using shader model ps_5_0 and vs_5_0 rather than loaded as part of an effect. Does anyone have any suggestions as to why I'm not getting point sampling? Here is the effects file if you want to take a glance (nothing very complicated). -------------------------------------------------------------------- Texture2D myTexture : register(t1); float4x4 localToClipCoordinateMatrix : register(b0); struct VertexShaderInput { float3 position : POSITION; float2 textureCoordinates : TEXCOORD; }; struct PixelShaderInput { float4 clipSpacePosition : SV_POSITION; float2 textureCoordinates : TEXCOORD; }; SamplerState mySampler { Filter = MIN_MAG_MIP_POINT; }; PixelShaderInput VS( VertexShaderInput input ) { PixelShaderInput output; output.clipSpacePosition = mul( float4(input.position,1.0f), localToClipCoordinateMatrix ); output.textureCoordinates = input.textureCoordinates; return output; } float4 PS( PixelShaderInput input ) : SV_Target { float4 output; output = myTexture.Sample(mySampler, input.textureCoordinates ); return output; }
  3. That is very helpful, though the sometimes vague language in msdn still leaves me a little uncertain about what is supposed to happen. It seems like the constant buffer doesn't have to have a vertex description like a vertex buffer does, instead it just counts on you setting up the same structs in both C++ and the effects file (and presumably guarantees it is going to pack them each the same way). In the example you cited there is a VSSetConstantBuffer method which takes a "start slot" as its first parameter and in the effects file there is an optional subscript which is what register to use ,e.g. register( b0 ) In the tutorial, these appear to match up (the struct which uses b0 is filled from slot 0,the struct with b1 is filled from slot 1 etc... ). Is that a requirment? I don't know what they mean by a "slot" here.
  4. I am still quite new to directx and am picking up directx 10 and 11. I compiled the shaders out of my effects file into a ID3D11PixelShader and ID3D11VertexShader using device->CreateVertexShader and device->CreatePixelShader . If I had instead created an effect I could use GetVariableByName to bind process variables to shader variables. However ID3D11PixelShader and ID3D11VertexShader don't seem to have any such method. How can I get variables from my effects file by name in this case?
  5. johnmortal

    Dropping the F-Bomb

    There is no need for profanity in my opinion.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!