쉐이더가 조금씩 생기고 있습니다.이 이상한 편집 오류가 계속 발생하여 저를 미치게합니다! 픽셀 쉐이더 이상한 컴파일 오류
다음 픽셀 쉐이더 코드 : DirectionVector = normalize(f3LightPosition[i] - PixelPos);
LightVec = PixelNormal - DirectionVector;
// Get the light strenght factor
LightStrFactor = float(abs((LightVec.x + LightVec.y + LightVec.z)/3.0f));
// TEST!!!
LightStrFactor = 1.0f;
// Add this light to the total light on this pixel
LightVal += f4Light[i] * LightStrFactor;
완벽하게 작동하지만, 최대한 빨리 분리 할 때 "LightStrFactor = 1.0F;" 즉, 'LightStrFactor'값을 위 계산의 결과로두면 셰이더를 컴파일하지 못합니다.
LightStrFactor는 LightVal & f4Light [I]를 float4 모든 나머지 float3되어있는 플로트 이다.
왜 내 컴파일러가 컴파일되지 않는 것입니까? DX 컴파일러가 어떻게 플로트의 가치에 관심이 있습니까? 내 값이 정확하지 않더라도 런타임이 아니어야합니까? 쉐이더 컴파일 코드는 이것이다 : 어떤 도움이 감사 감사
/* Compile the bitch */
if (FAILED(D3DXCompileShaderFromFile(fileName, NULL, NULL, "PS_MAIN", "ps_2_0", 0, &this->m_pCode, NULL, &this->m_constantTable)))
GraphicException("Failed to compile pixel shader!"); // <-- gets here :(
if (FAILED(g_D3dDevice->CreatePixelShader((DWORD*)this->m_pCode->GetBufferPointer(), &this->m_hPixelShader)))
GraphicException("Failed to create pixel shader!");
this->m_fLoaded = true;
! :]
무엇이 오류 메시지입니까? 오류가 발생하여 컴파일하는 동안 시간을내어 보내면 시간을 절약 할 수 있습니다. – Coincoin