Error when selecting between two shaders for material.

Rak'kar

30-01-2007 21:44:54

I'm trying to create a material. When I click "Edit" for the shader, it brings up a Dialog Box:

Shader Program has been modified or been used with another Render System.
Refresh the shader before editing parameters.
Seelct another shader then this again on the list.

Doing so has no effect.

There are two shaders to choose from in this case: .hlsl, and .cg. Selecting .cg works, hlsl brings up the error. I think the reason is that both the .hlsl and the .cg refer to the same file.

Here is the .material I'm trying to create using oFusion

.Material

material shield
{
technique
{
pass
{
scene_blend add
depth_write off

texture_unit
{
texture shield.png 2d
tex_coord_set 0
}
texture_unit
{
texture NoiseVolume.dds 3d
tex_coord_set 1
}

vertex_program_ref ShieldVP_hlsl
{
param_named_auto worldViewProj worldviewproj_matrix

}
fragment_program_ref ShieldFP_hlsl
{
param_named elapsedTime float 0.0
param_named timeScale float 5000
param_named hitDirection float3 0 0 1
param_named shieldStrength float 1
param_named hitStrength float 1
param_named finalColorScaler float 1.5
param_named sineWaveFrequency float 1.2
param_named decayScaler float 4.0
param_named decayExponent float 2
param_named spotScaler float 2
param_named fallOffExponent float 65.0
param_named speed float 1
}
}
}

// Use cg: support for both DirectX and OpenGL
technique
{
pass
{
scene_blend add
depth_write off

texture_unit
{
texture shield.png 2d
tex_coord_set 0
}
texture_unit
{
texture NoiseVolume.dds 3d
tex_coord_set 1
}

vertex_program_ref ShieldVP_cg
{
param_named_auto worldViewProj worldviewproj_matrix
}
fragment_program_ref ShieldFP_cg
{
param_named elapsedTime float 0.0
param_named timeScale float 5000
param_named hitDirection float3 0 0 1
param_named shieldStrength float 1
param_named hitStrength float 1
param_named finalColorScaler float 1.5
param_named sineWaveFrequency float 1.2
param_named decayScaler float 4.0
param_named decayExponent float 2
param_named spotScaler float 2
param_named fallOffExponent float 65.0
param_named speed float 1

}
}
}
}


.program


vertex_program ShieldVP_hlsl hlsl
{
source Shield.cg
entry_point ShieldVP
target vs_1_1
}

fragment_program ShieldFP_hlsl hlsl
{
source Shield.cg
entry_point ShieldFP
target ps_2_0
}

vertex_program ShieldVP_cg cg
{
source Shield.cg
entry_point ShieldVP
profiles vs_1_1 arbvp1
}

fragment_program ShieldFP_cg cg
{
source Shield.cg
entry_point ShieldFP
profiles ps_2_0 arbfp1
}

Lioric

30-01-2007 22:18:09

Is there a reason why you use the same source cg file in hlsl?

Rak'kar

30-01-2007 22:22:56

They both compile the same for now but we might want to split them later.