~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to extern/qdune/shaders/spotlight_hw.sqd

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# original source:
2
 
#light spotlight( float intensity = 1;
3
 
#                  color lightcolor = 1;
4
 
#                  point from = point "shader" (0,0,0);
5
 
#                  point to = point "shader" (0,0,1);
6
 
#                  float coneangle = radians(30);
7
 
#                  float conedeltaangle = radians(5);
8
 
#                  float beamdistribution = 2;)
9
 
#{
10
 
#    uniform vector A = normalize(to - from);
11
 
#    uniform float cosoutside = cos(coneangle);
12
 
#    uniform float cosinside = cos(coneangle - conedeltaangle);
13
 
#    illuminate (from, A, coneangle) {
14
 
#      float cosangle = (L . A) / length(L);
15
 
#      float atten = pow (cosangle, beamdistribution) / (L . L);
16
 
#      atten *= smoothstep (cosoutside, cosinside, cosangle);
17
 
#      Cl = atten * intensity * lightcolor;
18
 
#    }
19
 
#}
20
 
light spotlight
21
 
param uniform float intensity 1
22
 
param uniform color lightcolor 1 1 1
23
 
param uniform point from 0 0 0
24
 
param uniform point to 0 0 1
25
 
param uniform float coneangle 30
26
 
param uniform float conedeltaangle 5
27
 
param uniform float beamdistribution 2
28
 
temp uniform vector A
29
 
temp uniform float cosoutside
30
 
temp uniform float cosinside
31
 
temp float cosangle
32
 
temp float atten
33
 
temp float $1
34
 
temp float $2
35
 
const string $3 "shader"
36
 
global L Cl
37
 
codesegment @1
38
 
        ptocurr     from $3 from
39
 
        ptocurr     to $3 to
40
 
        radians     coneangle coneangle
41
 
        radians     conedeltaangle conedeltaangle
42
 
@1
43
 
        subvvv      A to from
44
 
        normalize   A A
45
 
        cos         cosoutside coneangle
46
 
        subfff      cosinside coneangle conedeltaangle
47
 
        cos         cosinside cosinside
48
 
        illuminate2 from A coneangle
49
 
        vdot        $1 L A
50
 
        length      $2 L
51
 
        divfff      cosangle $1 $2
52
 
        pow         $1 cosangle beamdistribution
53
 
        vdot        $2 L L
54
 
        divfff      atten $1 $2
55
 
        smoothstep  $1 cosoutside cosinside cosangle
56
 
        mulfff      atten atten $1
57
 
        mulvvf      Cl lightcolor intensity
58
 
        mulvvf      Cl Cl atten
59
 
        end_illuminate
60
 
        return