Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Go Back  Xtreme Visual Basic Talk > > > > Compile PixelShaders on the Run with D3DX


Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2008, 09:40 AM
Richard87 Richard87 is offline
Junior Contributor
 
Join Date: Sep 2004
Posts: 235
Unhappy Compile PixelShaders on the Run with D3DX


Hello, I copyed som sample pixelshader code from this article:
http://www.neatware.com/lbstudio/web/hlsl.html#pixel

But I cant seem to compile it, I get the following error code:
Code:
strErr = "error X3501: 'main': entrypoint not found "
This is the code I try to compile:
Code:
  float brightness;
  sampler2D tex0;
  sampler2D tex1;

  struct v2p {
    float4 Position  : POSITION;
    float2 Texcoord0 : TEXCOORD0;
    float2 Texcoord1 : TEXCOORD1;
    float4 Color     : COLOR0;
  };

  struct p2f {
    float4 Color : COLOR0;
  };

  void main( in v2p IN, out p2f OUT ) 
  {
    float4 color = tex2D(tex0, IN.Texcoord0);
    float4 bump = tex2D(tex1, IN.Texcoord1);
	OUT.Color = brightness * IN.Color * color;
  }
and this is the compilation 'rutine':
Code:
                Dim code As GraphicsStream = Nothing
                code = ShaderLoader.CompileShaderFromFile("C:\Prosjekt\Motion Detection\WebcamD3D\WebcamD3D\test.fx", "main", Nothing, Nothing, "ps_2_0", ShaderFlags.Debug, strErr, Nothing)
I have also tried the following:
Code:
                Dim code As GraphicsStream = Nothing
                Dim ec As EffectCompiler = EffectCompiler.FromFile("C:\Prosjekt\Motion Detection\WebcamD3D\WebcamD3D\test.fx", Nothing, ShaderFlags.Debug, strErr)
                Dim eh As EffectHandle = ec.GetFunction("main")

                code = ec.CompileShader(eh, "ps_2_0", ShaderFlags.Debug, strErr)
but with a generall exception, and this information from EC:
Code:
?ec.Description
{Microsoft.DirectX.Direct3D.EffectDescription}
    Creator: ""
    Functions: 0
    Parameters: 0
    Techniques: 0


Please help, I have no idea what I am doing wrong here, and I cant find any documentation enywhere:S
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
 
Compile PixelShaders on the Run with D3DX
Compile PixelShaders on the Run with D3DX
 
-->