[9408] | 1 | vertex_program glow_vs cg |
---|
| 2 | { |
---|
[9425] | 3 | source vs_glow.cg |
---|
| 4 | entry_point main |
---|
| 5 | profiles vs_1_1 arbvp1 |
---|
[9408] | 6 | } |
---|
| 7 | |
---|
| 8 | fragment_program glow_ps cg |
---|
| 9 | { |
---|
[9425] | 10 | source ps_glow.cg |
---|
| 11 | entry_point main |
---|
| 12 | profiles ps_2_0 arbfp1 |
---|
[9408] | 13 | } |
---|
| 14 | |
---|
| 15 | material glow |
---|
| 16 | { |
---|
[9425] | 17 | technique |
---|
| 18 | { |
---|
| 19 | pass |
---|
| 20 | { |
---|
| 21 | scene_blend alpha_blend |
---|
| 22 | depth_check on |
---|
| 23 | depth_func less_equal |
---|
| 24 | lighting off |
---|
[9427] | 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 |
---|
[9425] | 28 | |
---|
| 29 | vertex_program_ref glow_vs |
---|
| 30 | { |
---|
[9427] | 31 | //don't worry about auto parameters here, they are given |
---|
| 32 | param_named_auto iWorldTMatrix inverse_transpose_world_matrix |
---|
[9425] | 33 | param_named_auto iViewMatrix inverse_view_matrix |
---|
| 34 | param_named_auto worldMatrix world_matrix |
---|
| 35 | param_named_auto viewProjMatrix viewproj_matrix |
---|
[9427] | 36 | |
---|
| 37 | //how much should the glow expand from the model, usually a small value |
---|
| 38 | param_named inflate float 0.05 |
---|
[9425] | 39 | } |
---|
| 40 | |
---|
| 41 | fragment_program_ref glow_ps |
---|
| 42 | { |
---|
[9427] | 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 |
---|
[9425] | 57 | } |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | } |
---|
[9408] | 61 | } |
---|
| 62 | |
---|
| 63 | material 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 | { |
---|
[9425] | 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 |
---|
[9408] | 92 | } |
---|
| 93 | |
---|
| 94 | fragment_program_ref glow_ps |
---|
| 95 | { |
---|
[9425] | 96 | param_named alphaValue float 0.4 |
---|
| 97 | param_named cutoffAngle float 70.0 |
---|
| 98 | param_named exponent float 2.5 |
---|
[9408] | 99 | param_named_auto time time_0_x 50 |
---|
| 100 | param_named_auto color surface_emissive_colour |
---|
| 101 | } |
---|
| 102 | } |
---|
| 103 | |
---|
| 104 | } |
---|
| 105 | } |
---|