Original Post
Hi!
I wrapped up my lighting functions into useful functions to give my artist easier access to the lighting in the shaders. I wrote some functions which do the needed standard computations, taking some input parameters which are the same every time.
So, they go like this:
So that I can use it like this in my shaders:
The only problem is, that the HLSL compiler complains about those () I want. ( In the #define Bla() )
I want them, just because this here looks rather ugly (As Makros do anyway):
Someone knows a trick how to do this?
I wrapped up my lighting functions into useful functions to give my artist easier access to the lighting in the shaders. I wrote some functions which do the needed standard computations, taking some input parameters which are the same every time.
So, they go like this:
float3 GetDiffuseLighting_f(Texture2D LightBuffer, float2 ScreenUV, SamplerState Sampler){ //...}#define GetDiffuseLighting() GetDiffuseLighting_f(g_LightBuffer, GetScreenUV(), samScene);So that I can use it like this in my shaders:
return GetDiffuseLighting();The only problem is, that the HLSL compiler complains about those () I want. ( In the #define Bla() )
I want them, just because this here looks rather ugly (As Makros do anyway):
return GetDiffuseLighting;Someone knows a trick how to do this?