Answer Questions
Abdul Khaliq Oomatia HLSL pixel shader: problem with tex coord computation/texture lookup
I'm sitting on a strange problem for half a day now and can't figure out why things are happening as they happen. :) What I'm trying to do is to look up a texture with entries of size 3*3 texels each ( g_samCurvatureTex : this is a magnified part of it, the whole tex is repeated like this - I am only interested in the blue channel right now). At first I need to compute the centre index of the entry: #define CURV_TEX_ENTRIES 42 ...Show All
Sambuccus Using DirectX framework for ActiveX Control
I am developing an activex control that involves directx programming. I have used MFC Wizard to create the control, made a simple class for directx initialization setup and used this class object to draw the control. This is working fine. Now i want to take advantage of the directx framework (DXUT) instead of my simple directx class. But the way it works is through callback functions. There are many different classes for different tasks and call ...Show All
Jerome Le Bateau 64Bit and HAL devices
How can i use a HAL device in 64bit compiled applications Also all directx samples in the x64 bin run in REF mode only ... Has this something to do with my graphic card or with the SDK I'm using ATI radeon 9550 ... tnx, for info. I checked, on dxdiag it shows hal is enabled, but when i run the directx64.cpl from the DXSDK\Developer Runtime\x64 it shows hardware acceleration is not enabled. I enabled it ...Show All
Stuart Welwood Mesh Intersect Confusion
EDIT: Let me make my question simpler: How do I shoot a ray (using the Intersect function) from one mesh to another mesh Original Post: I recently found out that the Mesh.Intersect function requires you to transform the ray by the inverse of the Mesh's matrix. I can kinda understand how this works with picking, but, I am trying to shoot a ray from one mesh to another with an arbitrary direction. Now I'm dealing with TWO matrice ...Show All
punkrock Surfaces vs Textures
I have Cube Texture and i use it for env mapping, and i wanna draw cube object (env) with this texture. i use IDirect3DCubeTexture9:: GetCubeMapSurface but i cant set this surface to render ( IDirect3DDevice9:: SetTexture or ID3DXEffect:: SetTexture ) because it need IDirect3DBaseTexture9 interface. How convert IDirect3DSurface9 to IDirect3DBaseTexture9 without any copying of texture data or duplicate textures ...Show All
Adam Finster Using index buffers
I want to draw cube. And I want specify only 8 vertices, and then specify their order in special array. As I know index buffers allow to do so. But I can't find example. Please, write example of using index buffers. I wrote following program: using System; using System.Windows.Forms; using System.Drawing; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; namespace ProgaX { class Forma : ...Show All
John Kimball Setting a color mulitplier for a device
I have a number of objects which are aranged in a tree structure in a child parent relationship. When a parent renders, it sets the transformations, that it uses and then renders its children, which in turn sets their transformations by multiplying on the current world transform. That is pretty basic and pretty standard. Now I would like for children to "inherit" and modify the parents color as well. If a parent has the RGBA c ...Show All
Merco Problem solved
It appears that when I close the lid on my laptop, my program receives a DeviceLost message, but the program never receives the DeviceReset message after the laptop is re-opened. The same thing seems to happen when the screen saver runs. Any suggestions Thanks, Jeremy P.S. The source code is here: http://gosub.com/OpenSource/DirectXControl/DirectXControl.htm (it's a free DirectX control) ...Show All
Ignez Tom Miller's Render Loop
I am using vb.net 2003 an i am at a loss as to how to convert Tom Miller's render loop c# code sample into vb, could anyone help public void MainLoop() { // Hook the application's idle event System.Windows.Forms.Application.Idle += new EventHandler(OnApplicationIdle); System.Windows.Forms.Application.Run(myFor ...Show All
WiseWebbyOne How Use DirectX Draw a 2D Polygon which have a hole?
In C# We can Use SetClip() To draw 2d polygon which have a hole, But In Direct It's seem very hard to complete. Since you have to define the polygon in terms of triangles anyway, just make a few more triangles to define the shape with the hole in it. If the hole is defined mathematically, you can use pixel shaders to clip() pixels that you don't want rendered. If it's defined by an artist, texturing is probably the way to go, com ...Show All
GCParris movement pause
When I use this method in my render loop and hold down the key protected override void OnKeyDown(KeyEventArgs e) { //...move player } the player will move once, then after a pause continue to move. How do I get rid of the pause, so the player moves immediantly Thank You I had that problem too. I found the easiest way (for me since I tend to avoid unsafe code and prefer to use 100% .n ...Show All
bjun how to make a 3D Game using XNA Build
hello, I want to create my own game using XNA Build , but the tutorial that is provided on site is not so helpful for creating the game can u give some tutorial /document so that i can learn to develop the game on XNA Build. Or atlest provide some guideline to have some 3d effect using XNA Build. Thanks Meenal Hey Meenal, XNA Build is a program designed to make building code and content for games easier. It doesn't have any t ...Show All
Rich John Vertex shader problem
Hey, Ive been trying to add a vertex shader to my engine(right now its just running a pixel shader). Currentlly if I activate the vertex shader the world gets drawn distorted(a small random red box with a triangle going out to infinity). Heres the simple vertex shader im using. struct VS_INPUT { float3 position : POSITION; float4 color0 : COLOR0; flo ...Show All
NewtoC Mesh size versus scaling
OK, when creating a mesh (triangles) and defining my simple shape - a rectangle for example - what is the best approach on sizing. That is, should I make a big mesh so it is big when placed in the scene Or should I make the mesh small and then scale it or what ever during the scene One instance of this is putting up a "flat" background image into the scene to serve as the backdrop. I made a "large" mesh (-5, 4, 0 to 5, -4 ...Show All
ToddT slow backbuffer lock
I need to grab all my rendered pixels and pass them to a video card in order to show graphics on a tv. I can do so by locking the backbuffer and moving the pixels, but in my test it is quite slow. My framerate drops to abour 1/10th of the previous speed, and that is just too slow. Is there a faster way of moving my graphics onto my video buffer than lockbackbuffer and lockrectangle There should be faster ...Show All
