Original Post
In the SDK tutorials, some of them use .fx files to store shaders information, take Tutorial04 as an example, it has the .fx file "Tutorial04.fx",
[color=#ff0000]Can anybody tell me why if I create a .fx file with the same content(copy/paste from "Turotial04.fx") but different title, then change the two places in the code where the file title are used:
[source lang="cpp"]hr = CompileShaderFromFile( L"Tutorial04.fx", "PS", "ps_4_0", &pPSBlob );[/source]
Change L"Tutorial04.fx" to new .fx file tile
[source lang="cpp"]hr = CompileShaderFromFile( L"Tutorial04.fx", "VS", "vs_4_0", &pVSBlob );[/source]
Change L"Tutorial04.fx" to new .fx file title
Then the program pops up an error message? "
[source lang="java"]if( FAILED( hr ) )
{
MessageBox( NULL,
L"The FX file cannot be compiled. Please run this executable from the directory that contains the FX file.", L"Error", MB_OK );
return hr;
}[/source]
That says only a .fx file with title "Tutorial04" will work here, I guess it has something to do with the resource.h and Tutorial04.rc files, but I do not know what it is. Can anybody help? Thanks.
[color=#ff0000]Can anybody tell me why if I create a .fx file with the same content(copy/paste from "Turotial04.fx") but different title, then change the two places in the code where the file title are used:
[source lang="cpp"]hr = CompileShaderFromFile( L"Tutorial04.fx", "PS", "ps_4_0", &pPSBlob );[/source]
Change L"Tutorial04.fx" to new .fx file tile
[source lang="cpp"]hr = CompileShaderFromFile( L"Tutorial04.fx", "VS", "vs_4_0", &pVSBlob );[/source]
Change L"Tutorial04.fx" to new .fx file title
Then the program pops up an error message? "
[source lang="java"]if( FAILED( hr ) )
{
MessageBox( NULL,
L"The FX file cannot be compiled. Please run this executable from the directory that contains the FX file.", L"Error", MB_OK );
return hr;
}[/source]
That says only a .fx file with title "Tutorial04" will work here, I guess it has something to do with the resource.h and Tutorial04.rc files, but I do not know what it is. Can anybody help? Thanks.