[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 |
---|
| 25 | emissive 0.5 0.9 1.0 0.0 //what color should the glow be, emissive light can be changed through ogre as well |
---|
| 26 | |
---|
| 27 | vertex_program_ref glow_vs |
---|
| 28 | { |
---|
| 29 | param_named_auto iWorldTMatrix inverse_transpose_world_matrix //don't worry about auto parameters here, they are given |
---|
| 30 | param_named_auto iViewMatrix inverse_view_matrix |
---|
| 31 | param_named_auto worldMatrix world_matrix |
---|
| 32 | param_named_auto viewProjMatrix viewproj_matrix |
---|
| 33 | param_named inflate float 0.05 //how much should the glow expand from the model, usually a small value |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | fragment_program_ref glow_ps |
---|
| 37 | { |
---|
| 38 | param_named alphaValue float 0.5 //base alpha value of glow |
---|
| 39 | param_named cutoffAngle float 70.0 //from which view to surface normal angle on should the intensity of the glow decrease |
---|
| 40 | param_named exponent float 2.5 //by which exponent should the intensity decrease |
---|
| 41 | param_named_auto time time_0_x 50 //how fast should the light pulsate |
---|
| 42 | param_named_auto color surface_emissive_colour //don't worry about this one, it makes sure we use the emissive color value |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | } |
---|
[9408] | 47 | } |
---|
| 48 | |
---|
| 49 | material glow/drone |
---|
| 50 | { |
---|
| 51 | technique |
---|
| 52 | { |
---|
| 53 | pass |
---|
| 54 | { |
---|
| 55 | scene_blend alpha_blend |
---|
| 56 | depth_check on |
---|
| 57 | lighting off |
---|
| 58 | |
---|
| 59 | texture_unit |
---|
| 60 | { |
---|
| 61 | texture drone.png |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | pass |
---|
| 65 | { |
---|
| 66 | scene_blend alpha_blend |
---|
| 67 | depth_check on |
---|
| 68 | lighting off |
---|
| 69 | emissive 0.5 0.9 1.0 0.0 |
---|
| 70 | |
---|
| 71 | vertex_program_ref glow_vs |
---|
| 72 | { |
---|
[9425] | 73 | param_named_auto iWorldTMatrix inverse_transpose_world_matrix |
---|
| 74 | param_named_auto iViewMatrix inverse_view_matrix |
---|
| 75 | param_named_auto worldMatrix world_matrix |
---|
| 76 | param_named_auto viewProjMatrix viewproj_matrix |
---|
| 77 | param_named inflate float 0.2 |
---|
[9408] | 78 | } |
---|
| 79 | |
---|
| 80 | fragment_program_ref glow_ps |
---|
| 81 | { |
---|
[9425] | 82 | param_named alphaValue float 0.4 |
---|
| 83 | param_named cutoffAngle float 70.0 |
---|
| 84 | param_named exponent float 2.5 |
---|
[9408] | 85 | param_named_auto time time_0_x 50 |
---|
| 86 | param_named_auto color surface_emissive_colour |
---|
| 87 | } |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | } |
---|
| 91 | } |
---|