Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

568 Good

About smasherprog

  • Rank
    Advanced Member

Personal Information

  1. smasherprog

    Common Shading Language

    Just a suggestion, but instead of making a new language, why not use GLSL as "your" language --or HLSL. Then, write code to export the GLSL to HSLS/someotherlanguage?  In this way, you do not need to write an extra language, but work with what already exists -- it might be easier this way as well?
  2. smasherprog

    Camera axis always inverted somehow

    try removing the transpose from this line   XMStoreFloat4x4(&pTransformData->WorldViewProjection, XMMatrixTranspose(worldViewProj));   making it   XMStoreFloat4x4(&pTransformData->WorldViewProjection, worldViewProj);
  3. smasherprog

    Increasing Line Length

    to make any ray longer, you just multiply if by a scalar.   Meaning, if you have a ray, and you multiply it by two, the ray is twice as long . . .
  4. I successfully ported his examples to directx and ran into the same issues. Unfortunately, there were several places where the y and z components needed to be flipped. Both in the vertex shader and the pixel shader. First, get your vertex shader to draw properly.   Swap your final output y and z components in the vertex shader( but before you transform the vertex so the transform is correct). This will mess up your pixel shader. So try swaping the z and y components back at the beginning of the pixel shader. Then, make sure to swap the z and y components of anything externally set and used in all of the shaders, i.e. cameraposition, sunnormal
  5. smasherprog

    Compile errors

    This just means that the function bool InitializeDirect3d11App(HINSTANCE__ *) that is used in your _WinMain function is never defined anywhere   It is called, but the compiler cannot find the actual function definition.
  6. smasherprog

    SSAO and skybox artifact

    When dealing with shaders, ALL code is executed, including ALL branches, all function calls, etc. The ONLY exception for this is if something is known at compile time that will allow the compiler to remove a particular piece of code. This is how all graphics cards work, AMD, NVIDIA, etc. So, your additional cost is of the if statement, and in your example, you are adding an extra if instruction. This is a zero cost on gpus. If you want to read on it, check out vectors processors and data hazards. If you somehow split our shader up and added an if statement to the middle thinking that it would speed up your code, you would get NO speedup. because ALL paths will be executed.
  7. smasherprog

    Question about glGenTextures

    All gentextures does it get you a valid Texture ID. It doesn't actually create a texture for you. So, you would Usually, GenTexture //get an ID BindTexture //sets the active texture for work Fillorcreate the texture stuff here GenTexture should only be called when you want a NEW texture ID. If you are just updating a texture, or want to bind it for work, use the ID that you got from your GenTexture call when you created the resource.
  8. Like Erik said, the drawing function changes states, so you can use the ID3DX10Sprite::begin(D3DX10_SPRITE_SAVE_STATE); draw text inside here ID3DX10Sprite::end(); This will make sure your states are changed back to what they were before the draw text call.
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!