Quote:the only error I get is a C++ runtime error on my Effect.FromFile() line
What's the error?
By the way, I tried your file with no problem as far as:
strcat(strcpy( path, resPath ),"test.fx"); SAFE_RELEASE(pEffectProx); D3DXCreateEffectFromFile(m_pDevice, path, 0, 0, D3DXSHADER_DEBUG, 0, &pEffectProx, &errorBuffer); if( errorBuffer ) { MessageBox(NULL,(char*)errorBuffer->GetBufferPointer(),"pEffectProx creation error.",MB_OK); SAFE_RELEASE(errorBuffer); SAFE_RELEASE(pEffectProx); return E_FAIL; } else { HProxTechnique = pEffectProx->GetTechniqueByName("ColorCycle"); hr = pEffectProx->ValidateTechnique(HProxTechnique); // breakpoint. did not test beyond here. hr==S_OK
Assuming your file now looks like:
texture EffectTex;texture PaletteTex;float gOffset;sampler2D TextureSampler : TEXUNIT0 = sampler_state{ Texture = (EffectTex);};sampler2D PaletteSampler : TEXUNIT0 = sampler_state{ Texture = (PaletteTex);};//vertex to pixel shader structurestruct v2p{ float2 TexCoord : TEXCOORD0;};//pixel shader to screenstruct p2f{ float4 Color : COLOR0;};void CycleTextureColor(in v2p In, out p2f Out){ float4 color = tex2D(TextureSampler, In.TexCoord); float4 palcolor = tex2D(PaletteSampler, float2(color.r + gOffset, 0)); Out.Color = float4(color.r + gOffset, color.g + gOffset, color.b + gOffset, color.a);};technique ColorCycle{ pass P0 { VertexShader = NULL; PixelShader = compile ps_1_1 CycleTextureColor(); }}