rifter1818
Junior Contributor
Hi there does anyone know some good tutorials on HLSL ive had trouble with it, also some tutorials on implementing it as that too isnt working for me. Thanks for all your help.
Do you know of any service that can translate a whole site for me (i have enough trouble with english let allone italian). Thanks very much though, i think i can figure it out, the book i have is loading them as effects which is what was giving me so much trouble your way might be better for me. Although my Graphics card only supportsr VS_1_1 and PS_1_3... but oh well...RobyDx said:if you understand Italian my web site has it with full source code
robydx.altervista.org section directX9 - direct3D
hovever is simple, an example is enaugh to understand and for complex shader code is very usefull (for simple code is a waste of time).
if you has difficult tell me
hopefully one day ill be able to solve a problem for you, but that day seems quite distant right now...RobyDx said:altervista has a translation service. Probably one way is to install a translation program. Hovever you card 'll be enaght. If you need a debugger try my "shaderDK" in project SDK. It's a tool that I've realised that permit to write, test, debug and visualize shaders in every version and also in REF (so you can test 2.0 shaders also).
bye
dim PN() As VertexElement = {New VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0), _
New VertexElement(0, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0), VertexElement.VertexDeclarationEnd}
PositionNormal.VDec = New VertexDeclaration(D3d.Device, PN)
GS = ShaderLoader.CompileShaderFromFile(Application.StartupPath & "\...\VS-GlowPN.VSH", "VSGlowPN", Nothing, Nothing, "vs_1_1", ShaderFlags.None, Errors, Nothing)
Diagnostics.Debug.WriteLine(Errors)
PositionNormal.AddVertexShader("Glow", New VertexShader(D3d.Device, GS))
float GlowPower:register(c0);
float4x3 WorldView:register(c1);
float4x4 Projection:register(c49);
float4 GlowAmbient:register(c113);
float4 GlowColor:register(c117);
struct OUTPUT
{
float4 Position : POSITION;
float4 Diffuse : COLOR0;
};
OUTPUT VSGlowPN
(
float4 Position : POSITION,
float4 Normal : NORMAL
)
{
OUTPUT Out;
float3 N = normalize(mul(Normal, (float3x3)WorldView));
float3 P = mul(Position, WorldView) + GlowPower * N;
float3 A = float3(0, 0, 1);
float Power;
Power = dot(N, A);
Power *= Power;
Power -= 1;
Power *= Power;
Out.Position = mul(float4(P, 1), Projection);
Out.Diffuse = GlowColor * Power + GlowAmbient;
return Out;
}
RenderVertexBuffer: Error in the application.
-2146232832 (Unknown)
at Microsoft.DirectX.Direct3D.Device.DrawPrimitives(PrimitiveType primitiveType, Int32 startVertex, Int32 primitiveCount)
at W_Logic_RPG.DX9.Direct3d.RenderVertexBuffer(VertexBuffer& VertexBuffer, PrimitiveType PrimitiveType, Int32 StartVertex, Int16 PrimCount, Matrix Transform) in C:\Documents and Settings\Harry\Desktop\Programming\W-Logic RPG\clsDX901.vb:line 498