2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: A Shader GUI
[Re: Nadester]
#20756
12/06/03 10:45
12/06/03 10:45
|
Joined: Aug 2001
Posts: 426 USA
Homey
Senior Member
|
Senior Member
Joined: Aug 2001
Posts: 426
USA
|
I've been playing around with render monkey abit,it exports .fx files and then I use the c-script command
effect_load(material,string name);
"Loads an effect file in Microsoft .fx format from the work folder into the given material
Example:
effect_load(mtl_bump,"specularbump.fx");"
But it has errors because of the naming conventions used in render monkey I assume. Heres an simple .fx file exported from it.
Code:
//**************************************************************//
// Effect File exported by RenderMonkey
//
// - For this version, exporting to FX file is not perfect.
// There are many informations doesn't get exported.
// Currently, exporter does not try to resolve naming conflicts
// ( functions, variables etc )
// Please fix these issues before using this Effect file
//**************************************************************//
//--------------------------------------------------------------//
// Effect Group 1
//--------------------------------------------------------------//
//--------------------------------------------------------------//
// Effect 1
//--------------------------------------------------------------//
matrix matWorldViewProj;
string ModelData = "G:/Programming/ATI Technologies/RenderMonkey/v1.0/Examples/Media/Models/ElephantBody.3ds";
//--------------------------------------------------------------//
// Single Pass
//--------------------------------------------------------------//
struct VS_OUTPUT
{
float4 Pos: POSITION;
};
VS_OUTPUT vs_main( float4 inPos: POSITION )
{
VS_OUTPUT Out;
Out.Pos = mul(matWorldViewProj, inPos);
return Out;
}
float4 ps_main( float4 inDiffuse: COLOR0 ) : COLOR0
{
// Output constant color:
float4 color;
color[0] = color[3] = 1.0;
color[1] = color[2] = 0.0;
return color;
}
//--------------------------------------------------------------//
// Technique Section for Effect Group 1
//--------------------------------------------------------------//
technique Effect_1
{
pass Single_Pass
{
VertexShader = compile vs_1_1 vs_main();
PixelShader = compile ps_1_1 ps_main();
}
}
It would be great if someone could make a program to seemlessly convert these files so they could be loaded right up, with the effect_load() c-script command.
|
|
|
|