筆者介紹:姜雪偉,IT公司技術合伙人,IT高級講師,CSDN社區專家,特邀編輯,暢銷書作者,國家專利發明人;已出版書籍:《手把手教你架構3D游戲引擎》電子工業出版社和《Unity3D實戰核心技術詳解》電子工業出版社等。
不同的3D引擎對應的殊效文件是不同的,利用Particle Universe編輯器制作的殊效主要包括3部份:紋理文件、殊效腳本文件、材質腳本文件。下面把殊效的文件組織情勢介紹給讀者,制作殊效時首先需要紋理圖片,它的格式是png也就是有Alpha通道的貼圖,以下圖:
圖片是要寄存在材質腳本中的,材質文件的擴大名是.material,它的內容以下所示:
material pu_xs_light_0914 { technique { pass { lighting off scene_blend add depth_write off texture_unit pu_xs_jiguang04.png { texture_alias pu_xs_jiguang04.png texture pu_xs_jiguang04.png } } } }
system pu_xs_light_0007 { technique Technique4 { material pu_xs_light_0914 default_particle_width 7 default_particle_height 0.3 default_particle_depth 0.1 renderer Billboard { billboard_rotation_type vertex } emitter Point Emitter5 { emission_rate 1 angle 0 time_to_live 1 velocity 0.001 } affector Colour Affector10 { time_colour 0 0.00784314 0.458824 0.65098 1 time_colour 1 0.0392157 0.4 0.945098 1 } affector Scale Affector12 { xyz_scale dyn_random { min 0.5 max 1 } } } technique { material pu_flare default_particle_width 2 default_particle_height 2 default_particle_depth 2 spatial_hashing_cell_dimension 0 renderer Billboard { billboard_rotation_type vertex } emitter Point { emission_rate 1 angle 0 time_to_live 2 velocity 0.001 } affector Colour Affector7 { time_colour 0 0 1 1 1 time_colour 0.593478 0.113725 0.2 0.980392 1 time_colour 1 0.0705882 0 0.690196 0 } affector TextureRotator Affector9 { rotation_speed 1 } } }
接下來在下1章節,告知讀者如何使用制作的殊效。