   [MDX] HLSL results in nothing rendered
  Hello, I'm currently trying to learn how to use shaders, but have encountered a problem. When I use shaders nothing gets rendered, but without them, everything works fine. The code is somewhat based on MDXinfo's HLSL tutorialsrelevant pieces of code:Loading the effect:   Graphics.Effect = Direct3D.Effect.FromFile(Graphics.D3DHardware, "Shaders\simple.txt", Nothing, Nothing, ShaderFlags.PartialPrecision, Nothing)   Graphics.Effect.Technique = "simple"In the renderloop( I just try to render 1 triangle, it shows up if i comment the effect stuff):  Graphics.Matrices.WorldMatrix = Matrix.Identity  Graphics.Effect.SetValue("worldViewProj", Graphics.Matrices.WorldMatrix * Graphics.Matrices.ViewMatrix * Graphics.Matrices.ProjMatrix)  Graphics.Passes = Graphics.Effect.Begin(FX.None)  For index = 0 To Graphics.Passes - 1 Graphics.Effect.BeginPass(index) .SetTexture(0, Textures.Floor) .SetStreamSource(0, vb, 0) .DrawPrimitives(PrimitiveType.TriangleList, 0, 1) Graphics.Effect.EndPass()  Next  Graphics.Effect.End()The shader:float4x4 worldViewProj : WORLDVIEWPROJ; //our world view projection matrix//application to vertex structurestruct a2v{float4 position : POSITION0;    float4 texCoord : TEXCOORD0; };//vertex to pixel processing structurestruct v2p{    float4 position : POSITION0;    float4 texCoord : TEXCOORD0; };//VERTEX SHADERvoid vs( in a2v IN, out v2p OUT ) {    //transforming our position from object space to screen space.    OUT.position = mul(IN.position, worldViewProj);    //just telling direct3d that the outgoing texture coordinates are the same as the incoming.    OUT.texCoord = IN.texCoord; }technique simple{    pass p0    {   vertexshader = compile vs_1_1 vs();    }}If I use the retail directx runtimes the screen rendersblackIf i use the debugging runtimes the program freezes at the drawprimitive call and gives a first chance exception in d3dx.dllIf someone could tell me what I'm doing wrong i would be very grateful.Thanks in advance.edit: fixed the first chance exception, still nothing rendered though   
  The first thing I noticed, right off the bat is that you don't set your vertex declaration.  You need one in order to use HLSL.  If you have one, you need to set it (ie. Graphics.Declaration = vertexDecl) right before the SetStreamSource call, if not you need to create one.  I'm sure the MDXInfo tuts explain it more properly than I can with my limited memory of vertex declarations, so look through them again if you need info on how to create vertex declarations.  Hope that helps.-AJ   ;  I had set it earlier, sorry for not pasting that.Anyways i tried reproducing the problem with a lot less code, so I'm gonna paste it all and maybe you can see what I'm doing wrong from there:Imports Microsoft.DirectXImports Microsoft.DirectX.Direct3DImports Microsoft.DirectX.Direct3D.D3DXPublic Class Form1    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load   Dim D3DHardware As Direct3D.Device   Dim Effect As Direct3D.Effect   Dim D3DPP As New PresentParameters   Dim floor As Direct3D.Texture   Dim vb As VertexBuffer   Dim vba() As CustomVertex.PositionTextured   Me.Focus()   Me.Show()   With D3DPP  .Windowed = True  .AutoDepthStencilFormat = DepthFormat.D16  .EnableAutoDepthStencil = True  .BackBufferCount = 1  .BackBufferFormat = Format.A8R8G8B8  .BackBufferWidth = 1024  .BackBufferHeight = 768  .PresentationInterval = PresentInterval.Immediate  .SwapEffect = SwapEffect.Discard   End With   D3DHardware = New Direct3D.Device(0, DeviceType.Reference, Me, CreateFlags.SoftwareVertexProcessing, D3DPP)   With D3DHardware.RenderState  .ZBufferEnable = True  .Lighting = False  .SourceBlend = Blend.SourceAlpha  .DestinationBlend = Blend.InvSourceAlpha  .FillMode = FillMode.Solid  .CullMode = Cull.None  .AlphaBlendEnable = True   End With   floor = TextureLoader.FromFile(D3DHardware, "Pictures\floor.png", 0, 0, 0, Usage.None, Format.X8R8G8B8, Pool.Managed, Filter.Triangle, Filter.Triangle, Nothing)   Effect = Direct3D.Effect.FromFile(D3DHardware, "Shaders\simple.txt", Nothing, Nothing, ShaderFlags.PartialPrecision, Nothing)   Effect.Technique = "simple"   vb = New VertexBuffer(GetType(CustomVertex.PositionTextured), 3, D3DHardware, Usage.None, CustomVertex.PositionTextured.Format, Pool.Default)   vba = CType(Array.CreateInstance(GetType(CustomVertex.PositionTextured), 3), CustomVertex.PositionTextured())   vba(0) = New CustomVertex.PositionTextured(New Vector3(0, 0, 0), 0, 1)   vba(1) = New CustomVertex.PositionTextured(New Vector3(0, 0, 300), 0, 0)   vba(2) = New CustomVertex.PositionTextured(New Vector3(300, 0, 0), 1, 1)   vb.SetData(vba, 0, LockFlags.None)   D3DHardware.Transform.World = Matrix.Identity   D3DHardware.Transform.View = Matrix.LookAtLH(New Vector3(0, 500, -500), New Vector3(0, 0, 0), New Vector3(0, 1, 0))   D3DHardware.Transform.Projection = Matrix.PerspectiveFovLH(Math.PI / 4, 1.33, 10, 3000)   D3DHardware.VertexFormat = CustomVertex.PositionTextured.Format   While 3 = 3  Application.DoEvents()  With D3DHardware .Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.Black, 1, 0) .BeginScene() Effect.Begin(FX.None) Effect.BeginPass(0) .SetTexture(0, floor) .SetStreamSource(0, vb, 0) .DrawPrimitives(PrimitiveType.TriangleList, 0, 1) Effect.EndPass() Effect.End() .EndScene() .Present()  End With   End While   Effect.Dispose()   D3DHardware.Dispose()   End    End SubEnd ClassSorry for pasting all that code but I really don't know what to do =(, this code gives the exact same problem. if i comment these lines a triangle renders, otherwise nothing: Effect.Begin(FX.None) Effect.BeginPass(0) Effect.EndPass() Effect.End()I know its an infinite loop, this was just for testing purposes   