diff options
| author | Anton Novoselov <[email protected]> | 2017-08-01 12:53:38 +0300 |
|---|---|---|
| committer | Anton Novoselov <[email protected]> | 2017-08-01 12:53:38 +0300 |
| commit | 236f03c0b9a4982328ed1201978f7f69d192d9b2 (patch) | |
| tree | e486f2fa39dba203563895541e92c60ed3e25759 /docs/api_docs/files/pageextshaders.html | |
| parent | Added screens to welcome page (diff) | |
| download | blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.tar.xz blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.zip | |
Blast 1.1 release (windows / linux)
see docs/release_notes.txt for details
Diffstat (limited to 'docs/api_docs/files/pageextshaders.html')
| -rw-r--r-- | docs/api_docs/files/pageextshaders.html | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/api_docs/files/pageextshaders.html b/docs/api_docs/files/pageextshaders.html index f7b3099..836f4e5 100644 --- a/docs/api_docs/files/pageextshaders.html +++ b/docs/api_docs/files/pageextshaders.html @@ -1,6 +1,6 @@ <html> <head> - <title>NVIDIA(R) Blast(R) SDK 1.0 API Reference: Damage Shaders (NvBlastExtShaders)</title> + <title>NVIDIA(R) Blast(R) SDK 1.1 API Reference: Damage Shaders (NvBlastExtShaders)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css"> </head> @@ -20,23 +20,25 @@ </div> <!-- Generated by Doxygen 1.5.8 --> <div class="contents"> -<h1><a class="anchor" name="pageextshaders">Damage Shaders (NvBlastExtShaders) </a></h1>Blast Extensions provide basic implementations of programs generating fracture commands, the first step in breaking a Blast™ Actor, see <a class="el" href="pagellapi.html#splitting">Damage and Fracturing</a>. These programs come as two shader functions (callbacks) for Actors with a support graph and Actors with just one chunk respectively. The <a class="el" href="struct_nv_blast_damage_program.html">NvBlastDamageProgram</a> containing both shaders can be used for low-level directly (NvBlastActorGenerateFracture) or for TkActor's damage and fracture functions.<p> +<h1><a class="anchor" name="pageextshaders">Damage Shaders (NvBlastExtShaders) </a></h1>The Blast™ damage shader extension provides basic implementations of programs generating fracture commands, the first step in breaking a Blast™ Actor, see <a class="el" href="pagellapi.html#splitting">Damage and Fracturing</a>. These programs come as two shader functions (callbacks): one for Actors with a support graph, and one for Actors with just one chunk, respectively. The <a class="el" href="struct_nv_blast_damage_program.html">NvBlastDamageProgram</a> containing both shaders can be used for low-level directly (NvBlastActorGenerateFracture) or for TkActor's damage and fracture functions.<p> +For example, one may construct a damage program using the "shear" damage shaders declared in <a class="el" href="_nv_blast_ext_damage_shaders_8h.html">NvBlastExtDamageShaders.h</a>:<p> <div class="fragment"><pre class="fragment"> <a class="code" href="struct_nv_blast_damage_program.html">NvBlastDamageProgram</a> damageProgram = { <a class="code" href="_nv_blast_ext_damage_shaders_8h.html#4c050e75d4b9ddfcd3e85a620d21e029">NvBlastExtShearGraphShader</a>, <a class="code" href="_nv_blast_ext_damage_shaders_8h.html#1dd2944861a3adaccd62165b952f3440">NvBlastExtShearSubgraphShader</a> }; </pre></div><p> -The appropriate shader will be called for an Actor being processed, along with the necessary Actor's geometry and program parameters. The parameters (<a class="el" href="struct_nv_blast_program_params.html">NvBlastProgramParams</a>) are set to contain<p> +The appropriate shader ("graph" or "subgraph") will be called for an Actor being processed, along with the Actor's necessary geometry and program parameters. The parameters (<a class="el" href="struct_nv_blast_program_params.html">NvBlastProgramParams</a>) are set to contain<p> 1. Material, something that describes an Actor properties (e.g. mass, stiffness, fragility) which are not expected to be changed often.<p> 2. Damage description, something that describes a particular damage event (e.g. position, radius and force of explosion).<p> -<div class="fragment"><pre class="fragment"> <a class="code" href="struct_nv_blast_ext_material.html">NvBlastExtMaterial</a> material = { singleChunkThreshold, graphChunkThreshold, bondTangentialThreshold, bondNormalThreshold, damageAttenuation }; +For example:<p> +<div class="fragment"><pre class="fragment"> <a class="code" href="struct_nv_blast_ext_material.html">NvBlastExtMaterial</a> material = { health, minDamageThreshold, maxDamageThreshold }; <a class="code" href="struct_nv_blast_ext_radial_damage_desc.html">NvBlastExtRadialDamageDesc</a> damageDesc = { compressive, posX, posY, posZ, minR, maxR }; </pre></div><p> When used with TkActor::damage() functions, TkActor will cache the necessary data for deferred processing through TkGroup. This includes accumulating damage requests for the same material and program parameter combination. A default material can be set for a TkFamily that all its Actors uses.<p> +A Tk layer example follows.<p> <div class="fragment"><pre class="fragment"> tkGroup->addActor(*tkActor); tkActor->damage(damageProgram, damageDesc0, <span class="keyword">sizeof</span>(<a class="code" href="struct_nv_blast_ext_radial_damage_desc.html">NvBlastExtRadialDamageDesc</a>), &material); tkActor->damage(damageProgram, damageDesc1, <span class="keyword">sizeof</span>(<a class="code" href="struct_nv_blast_ext_radial_damage_desc.html">NvBlastExtRadialDamageDesc</a>), &material); tkGroup->process(); - tkGroup->sync(); </pre></div><p> -In contrast, the user is responsible for providing all the damage descriptions persisting through the low-level NvBlastActorGenerateFracture call when not using the Tk layer.<p> +In contrast, the user is responsible for providing all the damage descriptions persisting through the low-level NvBlastActorGenerateFracture call when not using the Tk layer:<p> <div class="fragment"><pre class="fragment"> <a class="code" href="struct_nv_blast_program_params.html">NvBlastProgramParams</a> programParams = { damageDescs, 2, &material }; <a class="code" href="_nv_blast_8h.html#6a40c4286de500e8545babfb9c517789">NvBlastActorGenerateFracture</a>(commandBuffers, actor, damageProgram, &programParams, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>); </pre></div> </div> |