DXnut

Members
  • Content count

    399
  • Joined

  • Last visited

Community Reputation

262 Neutral

About DXnut

  • Rank
    Member
  1. Thanks. That makes sense.
  2. If you call any function that alters the vertex buffer, you gotta save the buffer that gets returned and pass it into the pSkinInfo::Remap method. Since the pSkinInfo interface maps each bone to the vertices (the vertice's offset in the vertex buffer) each bone influences, you gotta keep them in sync.
  3. I am a tad confused about all this. I read some stuff on MSDN, but cannot find a real answer. So here it goes.... MDX 1.1 was their managed (.NET assembly) that acted as a managed interop wrapper around the current DX9.0c COM stuff. Right? MDX2.0 was just a new version of the same thing that added new functionality. But they have now deprecated MDX2.0. DX9.0c will be the final release for Windows XP, and DX9.0L will be the final release of DX9 that is written for Vista? So, I would imagine that 9.0L has the same interfaces we currently use for 9.0c, and the difference is what is used behind the scenes (what DLLs are linked to based on your compile target)? XNA is what then? They say that it is written for C# (not VB .NET?). It is meant so that game programmers can target Vista and XBOX360 with a unified set of managed resources. So, is it also a managed wrapper to interop with the same DX9.0L or DX10 COM components that we can also use with unmanaged C++? If we want to target DX10 for Vista and the special version of DX9 (?) for XBOX360 how is this done? Do you chose which version of DX it is to work with? If you just want to program for Vista can you chose DX9.0L or DX10 as your target? Or is it totally divorced from the DX9-DX10 COM stuff we use with C++? My real question would be if you can tell it to target DX9.0L instead of DX10 for Vista, so you could support Vista running with older graphics cards?? Then I would like to know how you would write your HLSL shaders to target SM4.0 or the DX9 versions?? I am missing the connection between XNA and DX. Thanks!
  4. Learning DirectX

    Regarding the FAQ, how can anyone miss that wacky dancing icon??? I crack up every time I see it.
  5. Fragment linkers

    Sorry. I may be wrong about the fragment linker. I looked at the SDK sample briefly, but decided for my needs I would use the fx file. I didn't see the ability to link different VS function together because it made no sense to me. Are you saying that in the FragmentLinker.fx file, you can take either: vertexfragment ProjectionFragment_Animated = compile_fragment vs_1_1 Projection( true ); vertexfragment ProjectionFragment_Static = compile_fragment vs_1_1 Projection( false ); and link it to: vertexfragment AmbientFragment = compile_fragment vs_1_1 Ambient(); or vertexfragment AmbientDiffuseFragment = compile_fragment vs_1_1 AmbientDiffuse(); ??? How would it link two separate functions together that take different inputs/outputs? I have a different PS for each combination of texture map mode (WRAP, CLAMP, MIRROR) and lighting equation (Phong or Blinn-Phong). I have one technique and then a different pass that will include the VS and PS I want. Then I just do the pEffect->BeginPass(#) to render with the VS/PS combo chosen. I am doing this in a mesh modeling program where I can change the texture and lighting modes on the fly. I have 6 passes defined for the different combos and several others I use for other things.
  6. Fragment linkers

    I am not sure what it is you are trying to do there. The purpose of the fragment linker thing is so that you can select one vertex shader function and one pixel shader function to use in the final compiled shader. This way you can dynamically select a pair that matches the computer's graphics ability and even to dynamically select what effect(s) to support depending on the type of gemotry you are rendering. If you want more than one to be available at run time, then using an effects file would be the way to go, since you can then either define separate techniques that perform a specific set of effects OR define passes within a technique that do exactly what you want to do. I found using different passes to be much faster than setting a new technique for rendering different objects within a render loop. However, the set of global parameters (like textures) that you setup at the top of a file to be used by the fragments or functions in an effect file cannot be modified on the fly for the vertex and pixel shader functions you decide to use. So, if you globally define a texture variable, it will be there for all of the pixel functions in that file to use. If you don't access the texture in a PS, then the compiler will not include it in its constants list. If you want a PS to access a texture and modulate the color, you need to provide that functionality in ONE PS function. You would need to create a different PS function for each of the combinations of things you want to do. Then you can use the fragmenter to use the PS function you want, or have an effects file call that function with a technique or pass.
  7. My maya x exporter bug

    This template MeshMaterialList { 4; 60; 0, 0, 0, says you have 4 subsets in the mesh. Maybe this is a problem? Are all of the 60 attribute buffer elements set to 0 except 1 being set to 1? How are you loading and rendering the mesh in your DirectX program?
  8. Thanks! I think I get it now. 1044957488 is 3E48C930 in hex. So it is saved as a decimal value (when the text format is used), you can use one of the string functions to convert it to a DWORD and then treat it like a float. Your post made me realize that the xfile loader does the same thing the compiler would do when converting a literal in a program.
  9. Reading an X File

    It would seem that you didn't register the templates.
  10. How to get vertex under mouse?

    I have a vertex picking function in my mesh editor. I don't use the D3DXIntersect for it. Here is what I have. My vertex buffer has the position (D3DXVECTOR3) and a D3DCOLOR for each one. It is a clone of the mesh vertex buffer that I use so I can draw the points only, and I set their color if they are picked differently. // lock the vertex buffer V_RETURN( mPointBuffer->Lock(0, 0, (LPVOID*)&VC, 0) ); for (UINT i = 0; i < VertexCount; i++) { D3DXVECTOR3 p = VC[i].pos; // get the vertex position // transform the position into world space (same as pick ray) D3DXVec3TransformCoord(&p, &p, &mWorldMatrix); // Get camera to vertex vector VfromCamera = p - PickRay.RayOrigin; D3DXVec3Normalize(&VfromCamera, &VfromCamera); // x = pickray.direction dot camToPosVector float x = D3DXVec3Dot(&PickRay.RayDirection, &VfromCamera); // angle in degrees between the pickray.direction and camToPosVector float angle = abs(D3DXToDegree(acosf(x))); // Do I want to check back facing ones? BOOL checkpoint = TRUE; if (g_bIgnoreBack) // Ignore back facing ones { // vector of object center to the vertex D3DXVECTOR3 c = mVecObjectPos - p; // if that vector dotted with camToPosVector < 0 it is back facing if (D3DXVec3Dot(&VfromCamera, &c) < 0) checkpoint = FALSE; // don't check it } // if the angle is < 0.2 I consider it picked if (angle < 0.2f && checkpoint) {
  11. HLSL array problems

    I am doing something very similar in my shaders, but have the maximum number of lights set to 2. There are plenty of constant registers for more than that, but when you do per pixel lighting in the shader, and are targeting PS_2_0, you can only access 15 constant registers in the PS versus 255 in the VS. I found that I can not do more than 2 lights because of this. If you are targeting PS_3_0 you will not be limited by that. I also found that it is easy to exceed the 64 instruction slot available in PS_2_0 (much less in PS_1_1). So if you add other features, like bump mapping you will apprach that limit as well.
  12. Here's a new one: http://triplebuffer.devmaster.net/tutorials/archive/
  13. It's a new interface/class. You cannot just force the D3DX function to take the interface to the old one. You have to modify the code that parses the x-file to use the new ID3DXFile interfaces.
  14. The D3DX function want the new ID3DXFiledata interface, which is part of the new ID3DXFile interface. You can't use the old interfaces with it.
  15. Try doing a clean on your project to force a complete recompile. If using DXUT, replace the directory of it with the one from the SDK you are using. Make sure that the correct directories for the SDK were installed in Tools/Projects and Solutions/VC++ Directories. Make sure you are using the right Dxxx.lib files in the Linker/Input section.