Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/materials/glow.material @ 9427

Last change on this file since 9427 was 9427, checked in by davidsa, 11 years ago

FIX: changed nested comments into single line comments, as it turns out Ogre material scripts don't like nested comments so my material script was broken

File size: 3.9 KB
Line 
1vertex_program glow_vs cg
2{
3        source vs_glow.cg
4        entry_point main
5        profiles vs_1_1 arbvp1
6}
7
8fragment_program glow_ps cg
9{
10        source ps_glow.cg
11        entry_point main
12        profiles ps_2_0 arbfp1 
13}
14
15material glow
16{
17        technique
18        {
19                pass
20                {
21                        scene_blend alpha_blend
22                        depth_check on
23                        depth_func less_equal
24                        lighting off
25
26                        //what color should the glow be, emissive light can be changed through ogre as well
27                        emissive 0.5 0.9 1.0 0.0
28                       
29                        vertex_program_ref glow_vs
30                        {
31                                //don't worry about auto parameters here, they are given
32                                param_named_auto iWorldTMatrix inverse_transpose_world_matrix
33                                param_named_auto iViewMatrix inverse_view_matrix
34                                param_named_auto worldMatrix   world_matrix
35                                param_named_auto viewProjMatrix viewproj_matrix
36
37                                //how much should the glow expand from the model, usually a small value
38                                param_named inflate float 0.05
39                        }
40                       
41                        fragment_program_ref glow_ps
42                        {
43                                //base alpha value of glow
44                                param_named alphaValue float 0.5
45
46                                //from which view to surface normal angle on should the intensity of the glow decrease
47                                param_named cutoffAngle float 70.0
48
49                                //by which exponent should the intensity decrease
50                                param_named exponent float 2.5
51
52                                //how fast should the light pulsate
53                                param_named_auto time time_0_x 50
54
55                                //don't worry about this one, it makes sure we use the emissive color value
56                                param_named_auto color surface_emissive_colour
57                        }
58                }
59               
60        }
61}
62
63material glow/drone
64{
65        technique
66        {
67                pass
68                {
69                        scene_blend alpha_blend
70                        depth_check on
71                        lighting off
72
73                        texture_unit
74                        {
75                                texture drone.png
76                        }
77                }
78                pass
79                {
80                        scene_blend alpha_blend
81                        depth_check on
82                        lighting off
83                        emissive 0.5 0.9 1.0 0.0
84
85                        vertex_program_ref glow_vs
86                        {
87                                param_named_auto iWorldTMatrix inverse_transpose_world_matrix
88                                param_named_auto iViewMatrix inverse_view_matrix
89                                param_named_auto worldMatrix   world_matrix
90                                param_named_auto viewProjMatrix viewproj_matrix
91                                param_named inflate float 0.2
92                        }
93                       
94                        fragment_program_ref glow_ps
95                        {
96                                param_named alphaValue float 0.4
97                                param_named cutoffAngle float 70.0
98                                param_named exponent float 2.5
99                                param_named_auto time time_0_x 50
100                                param_named_auto color surface_emissive_colour
101                        }
102                }
103               
104        }
105}
Note: See TracBrowser for help on using the repository browser.