Hello.
I have another problem in my adventure to creating Chams. So, I want to make the chams using shaders, but I want to make them a bit transparent, so I can still see the original actor texture behind the drawn chams.
Here is my GenerateShader function (pretty much pasted from mod_sa):
I, as last time, am sure that my DIP hook works perfectly, as the colors do actually get set, its just that the transparency is ignored. Here is the way I set the shaders:
And then I set the pixel shader using
I have another problem in my adventure to creating Chams. So, I want to make the chams using shaders, but I want to make them a bit transparent, so I can still see the original actor texture behind the drawn chams.
Here is my GenerateShader function (pretty much pasted from mod_sa):
Code:
HRESULT GenerateShader(IDirect3DDevice9 *Device, IDirect3DPixelShader9 **pShader, float alpha, float red, float green,
float blue)
{
char szShader[256];
ID3DXBuffer *pShaderBuffer = NULL;
sprintf_s(szShader, sizeof(szShader), "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", red, green, blue, alpha);
if (FAILED(D3DXAssembleShader(szShader, sizeof(szShader), NULL, NULL, 0, &pShaderBuffer, NULL)))
{
return E_FAIL;
}
if (FAILED(Device->CreatePixelShader((const DWORD *)pShaderBuffer->GetBufferPointer(), pShader)))
{
return E_FAIL;
}
return S_OK;
}
Code:
GenerateShader(Device, &chams_green, 0.0001f, 0.f, 1.f, 0.f);
Code:
Device->SetPixelShader(chams_green);