add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
28
gamedata/shaders/editor/lmodel.hlsli
Normal file
28
gamedata/shaders/editor/lmodel.hlsli
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef LMODEL_H
|
||||
#define LMODEL_H
|
||||
|
||||
#include "common.hlsli"
|
||||
|
||||
float4 plight_infinity(float m, float3 _point, float3 normal, float3 light_direction)
|
||||
{
|
||||
float3 N = normal; // normal
|
||||
float3 V = -normalize(_point); // vector2eye
|
||||
float3 L = -light_direction; // vector2light
|
||||
float3 H = normalize(L + V); // float-angle-vector
|
||||
return tex3D(s_material, float3(dot(L, N), dot(H, N), m)); // sample material
|
||||
}
|
||||
|
||||
float4 plight_local(float m, float3 _point, float3 normal, float3 light_position, float light_range_rsq)
|
||||
{
|
||||
float3 N = normal; // normal
|
||||
float3 L2P = _point - light_position; // light2point
|
||||
float3 V = -normalize(_point); // vector2eye
|
||||
float3 L = -normalize((float3)L2P); // vector2light
|
||||
float3 H = normalize(L + V); // float-angle-vector
|
||||
float rsqr = dot(L2P, L2P); // distance 2 light (squared)
|
||||
float att = saturate(1 - rsqr * light_range_rsq); // q-linear attenuate
|
||||
float4 light = tex3D(s_material, float3(dot(L, N), dot(H, N), m)); // sample material
|
||||
return att * light;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue