I want to make my own lighting shader. I already wrote one and I love how it looks.
However the only way I could get it to work is by doing this:
Code: Select all
HardwareShader Texture DESBR
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESBR2
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESDOOR
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESDOOR2
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESEDGE
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESGRASS
{
Shader "shaders/lighting.fp"
}
[ad infinitum]
With the current set-up, I would need to copy-paste this shader definition 479 times (and I didn't even count my sprites that would also need it, and this number will inevitably get bigger since it is an in-progress TC). That would be an incredibly obnoxious hell file.
I am hoping to instead just do something like omitting the texture name to make a shader apply to all of that type:
Code: Select all
HardwareShader Sprite
{
Shader "shaders/snaplighting.fp"
}
Or, better yet, a way to make a shader apply to all Texture/Flat/Sprites with a different keyword:
Code: Select all
HardwareShader Default
{
Shader "shaders/snaplighting.fp"
}
If another shader is defined for a specific texture name, then that would take priority over using the default shader.
(There could very well be something I'm missing, but I tried many things, searched on the forum, looked at the source code... and the one example I came across of a lighting shader like I would like to do was done in the exact way I would like to avoid doing. So I'm pretty sure there doesn't exist a way to do this, but I'd love to be wrong)
I want to make my own lighting shader. I already wrote one and I love how it looks.
However the only way I could get it to work is by doing this:
[code]HardwareShader Texture DESBR
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESBR2
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESDOOR
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESDOOR2
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESEDGE
{
Shader "shaders/lighting.fp"
}
HardwareShader Texture DESGRASS
{
Shader "shaders/lighting.fp"
}
[ad infinitum][/code]
With the current set-up, I would need to copy-paste this shader definition 479 times (and I didn't even count my sprites that would also need it, and this number will inevitably get bigger since it is an in-progress TC). That would be an incredibly obnoxious hell file.
I am hoping to instead just do something like omitting the texture name to make a shader apply to all of that type:
[code]HardwareShader Sprite
{
Shader "shaders/snaplighting.fp"
}[/code]
Or, better yet, a way to make a shader apply to all Texture/Flat/Sprites with a different keyword:
[code]HardwareShader Default
{
Shader "shaders/snaplighting.fp"
}[/code]
If another shader is defined for a specific texture name, then that would take priority over using the default shader.
(There could very well be something I'm missing, but I tried many things, searched on the forum, looked at the source code... and the one example I came across of a lighting shader like I would like to do was done in the exact way I would like to avoid doing. So I'm pretty sure there doesn't exist a way to do this, but I'd love to be wrong)