Jump to content


Member Since 17 Mar 2013
Offline Last Active Jan 23 2017 05:10 AM

Posts I've Made

In Topic: Picking In DirectX11 Using Bounding Box

26 June 2016 - 03:45 AM

// Get Picking Ray from Camera

        Public Function GetPickingRay(sp As Vector2) As Ray
            Dim v1 As Vector3
            Dim v2 As Vector3           
            Dim vp as Matrix = GetViewProjMatrixFromCamera()
            Dim Point As Vector3 = New Vector3(sp.X, sp.Y, 0)
            v1 = Vector3.Unproject(Point, Viewport.X, Viewport.Y, Viewport.Width, Viewport.Height, Viewport.MinZ, Viewport.MaxZ, vp)
            Point.Z = 1
            v2 = Vector3.Unproject(Point, Viewport.X, Viewport.Y, Viewport.Width, Viewport.Height, Viewport.MinZ, Viewport.MaxZ, vp)

            Dim Loc As Vector3 = v1
            Dim Dir As Vector3 = Vector3.Normalize(v2 - v1)

            Return New Ray(Loc, Dir)
        End Function


// Get Ray at Mouse Position
    Private Function GetTransformedRay(MousePos As Vector2, worldMat As Matrix, Editor As TEditor) As Ray
        Dim cRay As Ray = Editor.MyView.Camera.GetPickingRay(MousePos)
        Dim InvMat As Matrix = Matrix.Invert(worldMat)
        Return New Ray(Vector3.TransformCoordinate(cRay.Position, InvMat), Vector3.TransformNormal(cRay.Direction, InvMat))
    End Function

Here some Code, how I am doing ray picking an object. Using the GetTransformRay function you will get the Ray in ObjectSpace for the Object you want to test.

In Topic: .Net DX12

26 June 2016 - 02:49 AM

The biggest Pro for SlimDX by my opinion is, that it works fine with VB.NET. SharpDX does not support VB.NET because they messsed up some case sensitive exports. Another big point are projects which are already done in SlimDX. So @promit, pleeeeaasse continue your great work! :rolleyes:

In Topic: DirectCompute and Multi-GPU

23 May 2016 - 05:24 AM

mhh this is really frustrating, because I am bound to slimdx and there is no dx12. But the strange thing is, that its already possible for PhysX to move this to the second card and I don't think that PhysX is moving all the data back to CPU.

In Topic: Fluid - Spatial Grid

20 May 2016 - 04:18 AM

Hi _void_


thank you for your answer. I got it working like you suggested and its workling like a charm. BUT the problem I have now is the Grid-Size. I need to cover an 3D area of about 200x200x20m (and bigger) and to be fast enough I need a cell size of 10cm. In that case my lookup table (where I store the first and last Index of my sorted IndexList), would be about 6GB. Of course only 2% of cells would be filled so a lot of wasted storeage. I know DX12 comes with VolumeTiledRessouces, but I need to stay on DX11. Any idea?




In Topic: Fluid - Spatial Grid

16 May 2016 - 09:38 AM

Sorry I am not that math pro, but I need to get it work for vector 3 positions and 32bit indices. I would appreciate any code examples ;)