3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: possible to add proper spotlight support to this shader?
[Re: Kartoffel]
#402705
06/09/12 14:37
06/09/12 14:37
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Well I'm not using level-blocks in WED. I'm only using models for my whole levels. (some models have static-lightmaps)
I didn't test it, but I'm pretty sure just setting the LevelBlock's material to the lighting-shader won't work. I've never written a shader for level blocks, but I think they work different.
If you want to use LevelBlocks you have to use the standart lighting. The default engine lighting for level blocks shouldn't be that bad. by looking at specBump.fx it seems that blocks have their normal map on entSkin3 instead of entSkin2. Maybe creating a variant for blocks where the color map alpha is used for specular and entSkin3 is used for normal would work properly edit: I could get it working in blocks by commenting the define on line 13 (#define SPECULAR_ESKIN3) and in line 77 (inside NormalMapSampler) changing Texture = <entSkin2>; by Texture = <entSkin3>; Now if the shader could use color map alpha for specular it would be perfect
Last edited by painkiller; 06/09/12 14:43.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: possible to add proper spotlight support to this shader?
[Re: painkiller]
#402709
06/09/12 15:31
06/09/12 15:31
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
change line 163 to
float4 EffectMask = Color.a;
If you now uncomment #define SPECULAR_ESKIN3 (should be @line13) the alpha-channel of the color map is used as Specular-intensity give it a try!
Last edited by Kartoffel; 06/09/12 15:32.
POTATO-MAN saves the day! - Random
|
|
|
Re: possible to add proper spotlight support to this shader?
[Re: Kartoffel]
#402711
06/09/12 15:52
06/09/12 15:52
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
works perfectly! thank you very much!
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: possible to add proper spotlight support to this shader?
[Re: painkiller]
#402713
06/09/12 15:55
06/09/12 15:55
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Thats nice! Could you upload the modified .fx-file? Then I'll delete everything which isn't used anymore. (And I can use it, too  )
Last edited by Kartoffel; 06/09/12 16:01.
POTATO-MAN saves the day! - Random
|
|
|
Re: possible to add proper spotlight support to this shader?
[Re: Kartoffel]
#402714
06/09/12 16:04
06/09/12 16:04
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Thats nice! Could you upload the modified .fx-file? Then I'll delete everything which isn't used anymore. (And I can use it, too  ) Here it is a demo based on spot.c form samples folder. There are two variations of the original .fx, one which uses alpha as specular, and another one which I also modified for blocks ( just changing entSkin2 by entSkin3 in the NormalMapSampler ). In the scene there are two blobs, one is a model and the other one is a block. Download link: http://www.mediafire.com/?3wbdk4cwyex9pnj
Last edited by painkiller; 06/09/12 16:05.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: possible to add proper spotlight support to this shader?
[Re: pegamode]
#402739
06/09/12 18:38
06/09/12 18:38
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Color.a = fAlpha; applies the Entity.alpha to the output color with this you can make the entity transparent when decreasing the .alpha value of the entity This line isn't wrong... (Colormap alpha isn't supported, yet) you set Color.a = fAlpha, but you never set fAlpha fAlpha is passed by the engine to the shader. It contains the entity.alpha value with the range [0-1]
Last edited by Kartoffel; 06/09/12 18:40.
POTATO-MAN saves the day! - Random
|
|
|
|