Nanashi-soft○プログラマ専用○DirectX11開発○
for(int i=0; i < TYOUTEN; i++){ピクセルシェーダーを,テクスチャー描画の方にして
hVectorData[i].pos[0] = modeldata->vertex[i].pos[0];
hVectorData[i].pos[1] = modeldata->vertex[i].pos[1];
hVectorData[i].pos[2] = modeldata->vertex[i].pos[2];
hVectorData[i].col[0] = 0.0f;
hVectorData[i].col[1] = 0.0f;
hVectorData[i].col[2] = 0.5f;
hVectorData[i].col[3] = 1.0f;
// hVectorData[i].tex[0] = 0.0f; ↓そのままぶっこむ
hVectorData[i].tex[0] = modeldata->vertex[i].uv[0];
// hVectorData[i].tex[1] = 1.0f; ↓そのままぶっこむ
hVectorData[i].tex[1] = modeldata->vertex[i].uv[1];
}
hpDeviceContext->PSSetShader(hpPixelShader, NULL, 0);計算して,目の部分だけを描画する
hpDeviceContext->DrawIndexed(480, 38997, 0);
//ブレンディングステート生成
ID3D11BlendState* hpBlendState = NULL;
D3D11_BLEND_DESC BlendStateDesc;
BlendStateDesc.AlphaToCoverageEnable = FALSE;
BlendStateDesc.IndependentBlendEnable = FALSE;
for(int i=0; i < 8; i++){
BlendStateDesc.RenderTarget[i].BlendEnable = TRUE;
BlendStateDesc.RenderTarget[i].SrcBlend = D3D11_BLEND_SRC_ALPHA;
BlendStateDesc.RenderTarget[i].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
BlendStateDesc.RenderTarget[i].BlendOp = D3D11_BLEND_OP_ADD;
BlendStateDesc.RenderTarget[i].SrcBlendAlpha = D3D11_BLEND_ONE;
BlendStateDesc.RenderTarget[i].DestBlendAlpha = D3D11_BLEND_ZERO;
BlendStateDesc.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD;
BlendStateDesc.RenderTarget[i].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
}
hpDevice->CreateBlendState(&BlendStateDesc, &hpBlendState);
//そのブレンディングをコンテキストに設定
float blendFactor[4] = {D3D11_BLEND_ZERO, D3D11_BLEND_ZERO, D3D11_BLEND_ZERO, D3D11_BLEND_ZERO};
hpDeviceContext->OMSetBlendState(hpBlendState, blendFactor, 0xffffffff);
LoadInfo.Format = DXGI_FORMAT_R32G32B32_FLOAT;↓
LoadInfo.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;テクスチャーを読み込む際に透過色指定ができないものかと調べていたので,すぐに気が付きましたが,ハマる可能性もあるところです