Spellcaster Studios

Make it happen…

Effect system test…

Work has been lagging lately (well, this weekend it was “Mass Effect 3”’s fault), but I finally have something to show on the effect system:

As usual, the quality of the capture isn’t as good as I wanted, but it shows the effect anyway…

I’ll write more on the effect system, with an explanation on what’s behind the scenes when it’s completed (it still lacks plenty of components)…

The effect system is completely data-driven, and everything you see is defined on the XML specification of the effect; I’m very proud of it because it only took me 2 hours or so of “real” work to get those two effects working, without any artist assistance (yes, everything effect related is programmer art!).

Anyway, here’s a taste of what about I’m rambling about: here’s the effect definitions… It’s pretty straightforward (although it looks messy), the idea is to have in the future an editor for the effects (with a Flash-like timeline, etc):

    <light3d name="grey_palm_light">
       <pos>0,0,0</pos>
        <ori>0,0,0,1</ori>
        <scale>1,1,1</scale>
        <type>omni</type>
        <color>0.8,0.5,1.0,1.0</color>
        <attenuation start="1" end="3"/>
        <shadow_properties caster="false" factor="0.5" res_multiplier="0.25" antialias="false" epsilon="0.1"/>
    </light3d>
    <material name="grey_palm_light_ps_material">
        <graphic_args faceted="false" cull="none">
            <color>1.000000,1.000000,1.000000,1.000000</color>
            <intensity>1.000000,1.000000,0.000000,1.000000</intensity>
            <bump_factor>0.010000</bump_factor>
            <env_factor>1.000000</env_factor>
            <specular power="0.000000" gloss="0.0"/>
            <textures>
                <diffuse>
                    <texture>
                        <filename>particle.dds</filename>
                        <ss state="address_u" value="clamp"/>
                        <ss state="address_v" value="clamp"/>
                        <ss state="address_w" value="clamp"/>
                        <ss state="mag_filter" value="linear"/>
                        <ss state="min_filter" value="linear"/>
                        <ss state="mip_filter" value="linear"/>
                        <can_rescale value="true"/>
                    </texture>
                </diffuse>
            </textures>
            <alpha test="false" blend="true">
               <per_tri_sort>false</per_tri_sort>
                <lighting>false</lighting>
                <alpha_test_ref>1</alpha_test_ref>
                <alpha_blend_op>add</alpha_blend_op>
                <alpha_blend_src>src_alpha</alpha_blend_src>
                <alpha_blend_dest>one</alpha_blend_dest>
            </alpha>
            <render_prop>phong</render_prop>
        </graphic_args>
    </material>
    <texture name="glyph_texture">
        <filename>glyph.dds</filename>
        <ss state="address_u" value="clamp"/>
        <ss state="address_v" value="clamp"/>
        <ss state="address_w" value="clamp"/>
        <ss state="border_color" value="0"/>
        <ss state="mag_filter" value="linear"/>
        <ss state="min_filter" value="linear"/>
        <ss state="mip_filter" value="linear"/>
    </texture>
   <effect name="grey_summon">
       <object type="reference">
            <life_span start="0" end="3000" loop="false"/>
            <animation>
               <bone_anim start="0" end="3000" loop="false" animation="grey_summon_01" pre_roll="500ms"/>
            </animation>
        </object>
       <object type="light">
           <life_span start="0" end="3000" loop="false"/>
           <pos x="0" y="1" z="1"/>
            <pos_link value="true"/>
            <object_template name="grey_palm_light"/>
            <animation>
               <vec3_mountpoint property="pos" start="0%" end="100%" loop="true" mountpoint="left"/>
               <color_linear property="color" start="0%" end="20%" loop="false" start_r="0" start_g="0" start_b="0" start_a="1" end_r="0.8" end_g="0.2" end_b="1" end_a="1"/>
               <color_linear property="color" start="80%" end="100%" loop="false" start_r="0.8" start_g="0.2" start_b="1" start_a="1" end_r="0" end_g="0" end_b="0" end_a="1"/>
            </animation>
        </object>
       <object type="light">
           <life_span start="0" end="3000" loop="false"/>
           <pos x="0" y="1" z="1"/>
            <pos_link value="true"/>
            <object_template name="grey_palm_light"/>
            <animation>
               <vec3_mountpoint property="pos" start="0%" end="100%" loop="true" mountpoint="right"/>
               <color_linear property="color" start="0%" end="20%" loop="false" start_r="0" start_g="0" start_b="0" start_a="1" end_r="0.6" end_g="0.5" end_b="1" end_a="1"/>
               <color_linear property="color" start="80%" end="100%" loop="false" start_r="0.6" start_g="0.5" start_b="1" start_a="1" end_r="0" end_g="0" end_b="0" end_a="1"/>
            </animation>
        </object>
        <object type="particle_system">
           <life_span start="0" end="3000" loop="false"/>
            <local_reference value="true"/>
            <particle_life base="1000" variance="0.5"/>
            <particle_rate value="150"/>
            <particle_speed base="-0.1" variance="0.25"/>
            <emitter type="omni_sphere">
                <min_radius value="0.050"/>
                <max_radius value="0.075"/>
            </emitter>
            <renderer type="simple_point_sprite">
                <material name="grey_palm_light_ps_material"/>
                <auto_aabb value="true"/>
                <aabb min_x="-10" min_y="-10" min_z="-10" max_x="10" max_y="10" max_z="10"/>
                <particle_animation>
                    <float_sample property="size" sampling="linear">
                        <sample t="0.00" value="0.00"/>
                        <sample t="0.50" value="0.1"/>
                        <sample t="0.90" value="0.1"/>
                        <sample t="1.00" value="0.1"/>
                    </float_sample>
                    <colorref_sample property="color" sampling="linear">
                        <sample t="0.00" r="0.20" g="0.1" b="1.00" a="0.00"/>
                        <sample t="0.50" r="0.20" g="0.1" b="1.00" a="0.50"/>
                        <sample t="1.00" r="0.20" g="0.1" b="1.00" a="0.00"/>
                    </colorref_sample>
                </particle_animation>
            </renderer>
            <animation>
               <vec3_mountpoint property="pos" start="0%" end="100%" loop="true" mountpoint="right"/>
                <float_sample property="particle_rate" start="0%" end="100%" loop="false" sampling="step">
                    <sample t="0%" value="250"/>
                    <sample t="2000" value="0"/>
                </float_sample>
                <float_linear property="emitter.min_radius" start="0%" end="100%" loop="false" start_value="0.050" end_value="0"/>
                <float_linear property="emitter.max_radius" start="0%" end="100%" loop="false" start_value="0.075" end_value="0"/>
            </animation>
        </object>
        <object type="particle_system">
           <life_span start="0" end="3000" loop="false"/>
            <local_reference value="true"/>
            <particle_life base="1000" variance="0.5"/>
            <particle_rate value="150"/>
            <particle_speed base="-0.1" variance="0.25"/>
            <emitter type="omni_sphere">
                <min_radius value="0.050"/>
                <max_radius value="0.075"/>
            </emitter>
            <renderer type="simple_point_sprite">
                <material name="grey_palm_light_ps_material"/>
                <auto_aabb value="true"/>
                <aabb min_x="-10" min_y="-10" min_z="-10" max_x="10" max_y="10" max_z="10"/>
                <particle_animation>
                    <float_sample property="size" sampling="linear">
                        <sample t="0.00" value="0.00"/>
                        <sample t="0.50" value="0.1"/>
                        <sample t="0.90" value="0.1"/>
                        <sample t="1.00" value="0.1"/>
                    </float_sample>
                    <colorref_sample property="color" sampling="linear">
                        <sample t="0.00" r="0.20" g="0.1" b="1.00" a="0.00"/>
                        <sample t="0.50" r="0.20" g="0.1" b="1.00" a="0.50"/>
                        <sample t="1.00" r="0.20" g="0.1" b="1.00" a="0.00"/>
                    </colorref_sample>
                </particle_animation>
            </renderer>
            <animation>
               <vec3_mountpoint property="pos" start="0%" end="100%" loop="true" mountpoint="left"/>
                <float_sample property="particle_rate" start="0%" end="100%" loop="false" sampling="step">
                    <sample t="0%" value="250"/>
                    <sample t="2000" value="0"/>
                </float_sample>
                <float_linear property="emitter.min_radius" start="0%" end="100%" loop="false" start_value="0.050" end_value="0"/>
                <float_linear property="emitter.max_radius" start="0%" end="100%" loop="false" start_value="0.075" end_value="0"/>
            </animation>
        </object>
        <object type="quad">
           <life_span start="0" end="3000" loop="false"/>
            <pos x="0" y="0.01" z="0"/>
            <scale x="1" y="1" z="1"/>
            <axis0 x="1" y="0" z="0"/>
            <axis1 x="0" y="0" z="1"/>
            <size x="3" y="3"/>
            <color r="0.25" g="0.1" b="1" a="1.0"/>
            <texture type="diffuse" name="glyph_texture"/>
            <material name="effect_material"/>
            <animation>
                <float_linear property="color.a" start="0000" end="500" loop="false" start_value="0" end_value="1"/>
                <float_linear property="color.a" start="2500" end="3000" loop="false" start_value="1" end_value="0"/>
                <quat_axis property="ori" start="0" end="3000" loop="false" axis_x="0" axis_y="1" axis_z="0" angle="720"/>
            </animation>
        </object>
    </effect>
    <material name="fire_effect_material">
        <graphic_args faceted="false" cull="none">
            <color>1.000000,1.000000,1.000000,1.000000</color>
            <intensity>1.000000,1.000000,0.000000,1.000000</intensity>
            <bump_factor>0.010000</bump_factor>
            <env_factor>1.000000</env_factor>
            <specular power="0.000000" gloss="0.0"/>
            <textures>
                <diffuse>
                    <texture>
                        <filename>fire_particle.dds</filename>
                        <ss state="address_u" value="clamp"/>
                        <ss state="address_v" value="clamp"/>
                        <ss state="address_w" value="clamp"/>
                        <ss state="mag_filter" value="linear"/>
                        <ss state="min_filter" value="linear"/>
                        <ss state="mip_filter" value="linear"/>
                        <can_rescale value="true"/>
                    </texture>
                </diffuse>
            </textures>
            <alpha test="false" blend="true">
               <per_tri_sort>false</per_tri_sort>
                <lighting>false</lighting>
                <alpha_test_ref>1</alpha_test_ref>
                <alpha_blend_op>add</alpha_blend_op>
                <alpha_blend_src>one</alpha_blend_src>
                <alpha_blend_dest>inv_src_alpha</alpha_blend_dest>
            </alpha>
            <render_prop>phong</render_prop>
        </graphic_args>
    </material>
    <light3d name="imp_fire_light">
       <pos>0,0,0</pos>
        <ori>0,0,0,1</ori>
        <scale>1,1,1</scale>
        <type>omni</type>
        <color>1.0,0.5,0.2,1.0</color>
        <attenuation start="1" end="3"/>
        <shadow_properties caster="false" factor="0.5" res_multiplier="0.25" antialias="false" epsilon="0.1"/>
    </light3d>
   <effect name="imp_summon">
       <object type="reference">
            <life_span start="0" end="9000" loop="false"/>
            <visible value="false"/>
            <animation>
               <bone_anim start="0" end="3000" loop="false" animation="imp_idle_02" pre_roll="500ms"/>
               <bone_anim start="3000" end="4500" loop="false" animation="imp_idle_01" pre_roll="250ms"/>
               <bone_anim start="4500" end="6000" loop="false" animation="imp_idle_01" pre_roll="250ms"/>
               <bone_anim start="6000" end="9000" loop="false" animation="imp_idle_02" pre_roll="500ms"/>
                <bool_sample property="visible" start="0" end="4000" loop="false">
                    <sample t="0" value="false"/>
                    <sample t="100%" value="true"/>
                </bool_sample>
                <float_linear property="material.alpha" start="4000" end="6000" loop="false" start_value="0" end_value="1"/>
                <bool_sample property="material.alpha_material" start="4000" end="6000" loop="false">
                    <sample t="0" value="true"/>
                    <sample t="100%" value="false"/>
                </bool_sample>
                <float_linear property="material.emissive" start="6000" end="7000" loop="false" start_value="0" end_value="1"/>
            </animation>
        </object>
       <object type="light">
           <life_span start="0" end="8000" loop="false"/>
           <pos x="0" y="1" z="0"/>
            <pos_link value="true"/>
            <object_template name="imp_fire_light"/>
            <animation>
               <color_linear property="color" start="0%" end="1000" loop="false" start_r="0" start_g="0" start_b="0" start_a="1" end_r="1" end_g="0.8" end_b="0" end_a="1"/>
               <color_linear property="color" start="6000" end="100%" loop="false" start_r="1" start_g="0.8" start_b="0" start_a="1" end_r="0" end_g="0" end_b="0" end_a="1"/>
            </animation>
        </object>
        <object type="particle_system">
           <life_span start="0" end="6000" loop="false"/>
            <local_reference value="true"/>
            <particle_life base="2000" variance="0.5"/>
            <particle_rate value="500"/>
            <particle_speed base="0.025" variance="0.25"/>
            <emitter type="pose">
            </emitter>
            <physics type="std_force">
                <direction x="0" y="1" z="0"/>
                <strength value="0.0025"/>
                <max_speed value="0.1"/>
            </physics>
            <renderer type="simple_point_sprite">
                <material name="fire_effect_material"/>
                <auto_aabb value="false"/>
                <aabb min_x="-1" min_y="-1" min_z="-1" max_x="1" max_y="1" max_z="1"/>
                <particle_animation>
                    <float_sample property="size" sampling="linear">
                        <sample t="0.00" value="0.00"/>
                        <sample t="0.20" value="0.10"/>
                        <sample t="1.00" value="0.30"/>
                    </float_sample>
                    <colorref_sample property="color" sampling="linear">
                        <sample t="0.00" r="0.20" g="0.20" b="0.00" a="0.00"/>
                        <sample t="0.60" r="0.20" g="0.00" b="0.00" a="0.00"/>
                        <sample t="0.80" r="0.00" g="0.00" b="0.00" a="0.60"/>
                        <sample t="1.00" r="0.00" g="0.00" b="0.00" a="0.00"/>
                    </colorref_sample>
                </particle_animation>
            </renderer>
            <animation>
            </animation>
        </object>
    </effect>

Comment