Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 02 Apr 2011
Offline Last Active Yesterday, 10:01 PM

Topics I've Started

vs 2013 hlsl

18 May 2015 - 07:23 PM

Hey. I am using Visual Studio 2013 and when I try to get assembly output by setting it in Properties in VS it gives me error: Element <AssemblerOutput> has an invalid value of "AssemblyCode". If I add /Fc [filepath] to the additional options in Properties then it outputs fine. I couldn't find anything online about this. Is there a solution for it?



vs 5_0 texture sampling

30 April 2014 - 12:39 PM

I have a height map in my vertex shader that I use to move the vertex to right height. I use r32g32b32 texture. But when I create graphics device with debug flag I get the error below. Even though it shows me error everything works fine I mean I get the right height for the terrain. So do I need to change the format of my texture or is there a way to sample r32g32b32 textures on vertex shader?

D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The Shader Resource View in slot 1 of the Vertex Shader unit is using the Format (R32G32B32_FLOAT). This format does not support 'Sample', 'SampleLevel', 'SampleBias' or 'SampleGrad', at least one of which may being used on the Resource by the shader. The exception is if the corresponding Sampler object is configured for point filtering (in which case this error can be ignored). This also only applies if the shader actually uses the view (e.g. it is not skipped due to shader code branching). [ EXECUTION ERROR #371: DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED]

raw input mouse problem

04 April 2014 - 12:29 PM

I created a simple input system and it works mostly. Right now I have a camera that is moved with the mouse when left button is clicked. The problem I am having is when mouse button is clicked even when I stop moving the mouse lastX or lastY doesnt become 0 and camera keeps moving until I stop clicking the button. Here is my code

//InputManager::HandleInput() function

UINT dwSize;

GetRawInputData(rawInput, RID_INPUT, 0, &dwSize, sizeof(RAWINPUTHEADER));

LPBYTE lpb = new BYTE[40];
if(GetRawInputData(rawInput, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)) != dwSize)
	OutputDebugString("Cannot get raw input data!");

if(raw->header.dwType == RIM_TYPEMOUSE)
        mouseInfo.movementX = raw->data.mouse.lLastX;
        mouseInfo.movementY = raw->data.mouse.lLastY;
        //printf("mouse movement x=%d, y=%d\n", raw->data.mouse.lLastX, raw->data.mouse.lLastY);

        bool downState = (raw->data.mouse.usButtonFlags & RI_MOUSE_LEFT_BUTTON_DOWN) > 0;
        bool upState = (raw->data.mouse.usButtonFlags & RI_MOUSE_LEFT_BUTTON_UP) > 0;

        if(downState == true && upState == false)
            mouseInfo.leftButton = true;
        if(upState == true)
            mouseInfo.leftButton = false;

        downState = (raw->data.mouse.usButtonFlags & RI_MOUSE_RIGHT_BUTTON_DOWN) > 0;
        upState = (raw->data.mouse.usButtonFlags & RI_MOUSE_RIGHT_BUTTON_UP) > 0;

        if(downState == true && upState == false)
            mouseInfo.rightButton = true;
        if(upState == true)
            mouseInfo.rightButton = false;

rasterizer state resets

01 April 2014 - 06:06 PM

I created a wireframe rasterizer state and it works if I set it everytime I render an object. But if I initialized it one time next frame it resets to default rasterizer state. Is this the default behaviour or there is something wrong with my code?

Making an object accessible by other classes

11 December 2013 - 05:39 AM

Since we all know global variables are bad I am trying to find a way to make an object accessible by others. So in particular my graphics device which contains basically directx interface. So a lot of my classes are using this graphics device class in different functions so I don't think passing the pointer in the function is the best idea. So I was thinking about making a base class for all the classes using graphics device. And making this class contain the graphics device. But I dont know if this is the best idea so I am looking for suggestions. I didnt want to implement singleton since there might be more than one graphics device.