Jump to content
  • Advertisement

static_roller

Member
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

128 Neutral

About static_roller

  • Rank
    Member
  1. Thanks for the suggestions, both very simple & straightforward!   But, I tried setting FirstMipLevel to 2 (and 3), but didn't notice any difference in appearance or video memory usage.. Does it work only for DDS? I stopped using DDS files at some point because of their horrible file size (they were uncompressed though I believe) and the game has lots of textures..   D3DX11GetImageInfoFromFile seems to work fairly nice however, operation takes only 1-3ms so I think I'll go with that for now.
  2. In the alpha of my driving game I'm currently offering two texture resolution settings: (very) low, which loads textures as 64x64 (excluding any GUI textures) and normal which load them as is (resolutions varying anything from  ~8x8 to 2048x2048). I did some vehicle interior texturing this weekend and noticed then that this new texturing looks absolutely horrid on my laptop w/ low settings.   An elegant solution in my mind would be to give D3DX11_IMAGE_LOAD_INFO a flag to tell to NOT upscale any textures, which the documentation tells it will do if I were to define width and height bigger than the texture actually is. But I havent found such a flag. This is why currently I give only 0 or 64 for the width and height for the load info.   I do have some less elegant ideas which I wouldn't prefer (otherwise I guess I wouldn't have this problem this day). I've tried searching the subject and saw some mipmap level related solutions, but seemed kind of a hassle and the solutions I saw weren't DX11 specific, and not sort of complete enough for me to understand. To be specific, I was left with an "understanding" that I would need to add new sampler(s) to the HLSL or something weird & messy like that, also the actual loading seemed like a mess too compared to what I'm doing now.. Such mess is lacking the elegancy I'm looking for here, but if it's the only way to go then sure..  
  3. Ok thanks, I'll keep this in mind next time I get back to shader optimization / rewriting work, but for now the cameraOffset fix does ok. Thanks again!
  4. I just added a simple cameraOffset vector so that the vehicle and the camera positions are set to the "center" before the render, no distortion any more :)     Thanks for the help!
  5. So I did a quick test rendering the vehicle with just identity matrix and D3DXMatrixLookAtLH(&g.viewMatrix, &D3DXVECTOR3(0, 4, -5), &D3DXVECTOR3(0, 4, 1), &D3DXVECTOR3(0, 1, 0)); after normal world render, so I guess this approach could work.. But I'm intrested to hear what you mean exactly with the combined model*view matrix. I don't understand matrices too well, I just use them like Jack Hoxley told me to in his DirectX4VB tutorial back in the day :D
  6. uh having some trouble editing the code.. edit: post, lol   But are you saying I should provide identity view matrix for the shader and include (multiply) the view matrix to the world matrix at cpp side? I'm not quite following.. But I will take another look tomorrow..   Btw looks like world matrix is in a wrong cbuffer, optimization todo right there I guess..
  7. 3:30am can't get no sleep thinking about this, but can't get my drunken ass head quite wrapped around this. I do know that some implementations have the character in the center and just move the world around (how common is that btw)? But that would be quite a hassle at this time, I'm thinking render the world in the edge of the hell where it is and then go with the camera to "the center" and render the vehicle there, is that possible? I just don't know, never done such thing, I currently just render things where they are, camera in single position whole frame. There is some world stage system which moves all things back after going further another 10km but that's another story..   Edit: re-read your post, uh I don't know, here's some shader code, view, projection and world matrices are separate.. cbuffer cbView { matrix View; matrix Projection; };   cbuffer cbSubset { matrix World; float4 diffuseColor; float enableTexture[2]; }; ...    PS_INPUT vsBase( VS_INPUT input ) {   ...   output.pos=input.pos; output.tex = input.tex; output.worldPos = mul( output.pos, World );    output=vsCommon(output); output=vertexSFX(output, input.instanceId);   output.pos = mul( output.worldPos, View ); //transform position to clip space - keep worldspace position output.pos = mul( output.pos, Projection );
  8. Thanks for the reply, I think I am and I just tested jumping to the center of the map and set the 300km/h emulation on and no distortion whatsoever! So I should somehow render the vehicle at position 0, 0, 0? I will get back to this tomorrow with a more clear head.. Thanks again!
  9. I started thinking, is this a float precision problem? I mean let's suppose a vertice at 1.396 after scaling to 0.048116 according to calculator is 0.067169936, is it just too small number for float to handle? I do know floats have some precision problems and limited amount of digits but don't know much more than that..
  10. I currently have these (commented out though as neither does nothing):   //g.farPlane=200; //g.nearPlane=0.1;   //g.farPlane=2; //g.nearPlane=0.03;   Defaults for the engine are: nearPlane=0.1f; farPlane=35000.0f;    Edit: I tested some small values for the engine defaults with no changes to the values midframe, couldn't see much of the world anymore but cockpit was still distorted. I also tried some further nearplane value for the vehicle rendering midframe which made just some front parts of the vehicle visible, so I guess changing the values mid frame kinda works, but it would seem this problem is related maybe to something else, I don't know..
  11. Hey everyone,   I'm developing a driving game and for sense of speed I use variable FOV according to speed. But I do not apply the FOV to the driven car but instead scale it down to keep it properly sized in relation to the surroundings. Problem is that with enough speed the cockpit starts to go all distorted, see this picture:     Here you can see the problem in action:    Initially I assumed this would be a depth buffer issue, but it happens even with DepthEnable=false.   I'm rendering the car last, clear the depth buffer and try to set much lower near plane and far planes using D3DXMatrixPerspectiveFovLH, but it would appear it does absolutely nothing, no matter the values, is maybe something else required to change the near & far planes mid frame? Or is the problem related to something else?   The scale values given for D3DXMatrixScaling in the particular image above (simulated speed of 300km/h) are quite low: scaleX: 0.048116, scaleY: 0.048116, scaleZ: 0.048116   The car's original size is something like X: 20, Z: 50, one meter is 10 units (not sure what to call them) in the engine.   I can give more details if needed.   Hopefully somebody can help me, I think I may have some other questions in the future too, this is I think my first ever DX related question on a forum.   Thanks,   static_roller
  12. Hello, [forbidden text removed by moderator]
  • 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!