Main Page Class List Class Members

# sdk/extensions/shaders/include/NvBlastExtDamageShaders.h File Reference

`#include "NvBlastTypes.h"`
`#include "NvBlastDebugRender.h"`

Go to the source code of this file.

## Classes
struct | NvBlastExtCapsuleRadialDamageDesc
class | NvBlastExtDamageAccelerator
struct | NvBlastExtImpactSpreadDamageDesc
struct | NvBlastExtMaterial
struct | NvBlastExtProgramParams
struct | NvBlastExtRadialDamageDesc
struct | NvBlastExtShearDamageDesc
struct | NvBlastExtTriangleIntersectionDamageDesc
## Functions
NVBLAST_API void | NvBlastExtCapsuleFalloffGraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtCapsuleFalloffSubgraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtCutterGraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtCutterSubgraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
NVBLAST_API NvBlastExtDamageAccelerator * | NvBlastExtDamageAcceleratorCreate (const NvBlastAsset *asset, int type)
NVBLAST_API void | NvBlastExtFalloffGraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtFalloffSubgraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtImpactSpreadGraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtImpactSpreadSubgraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtShearGraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtShearSubgraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtTriangleIntersectionGraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NVBLAST_API void | NvBlastExtTriangleIntersectionSubgraphShader (NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)

## Function Documentation

NVBLAST_API void NvBlastExtCapsuleFalloffGraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastGraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

Capsule Radial Falloff damage for both graph and subgraph shaders.

For every bond/chunk damage is calculated from the distance to line segment AB described in NvBlastExtCapsuleRadialDamageDesc. If distance is smaller then minRadius, full compressive amount of damage is applied. From minRadius to maxRaidus it linearly falls off to zero.

NOTE: The signature of shader functions are equal to NvBlastGraphShaderFunction and NvBlastSubgraphShaderFunction respectively. They are not expected to be called directly.

See also:
  NvBlastGraphShaderFunction, NvBlastSubgraphShaderFunction

NVBLAST_API void NvBlastExtCapsuleFalloffSubgraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastSubgraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

NVBLAST_API void NvBlastExtCutterGraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastGraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

NVBLAST_API void NvBlastExtCutterSubgraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastSubgraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

NVBLAST_API NvBlastExtDamageAccelerator* NvBlastExtDamageAcceleratorCreate | ( | const NvBlastAsset * | asset,
|  | int | type |
| ) |  |  |

NVBLAST_API void NvBlastExtFalloffGraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastGraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

Radial Falloff and Radial Cutter damage for both graph and subgraph shaders.

NOTE: The signature of shader functions are equal to NvBlastGraphShaderFunction and NvBlastSubgraphShaderFunction respectively. They are not expected to be called directly.

See also:
  NvBlastGraphShaderFunction, NvBlastSubgraphShaderFunction

NVBLAST_API void NvBlastExtFalloffSubgraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastSubgraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

NVBLAST_API void NvBlastExtImpactSpreadGraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastGraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

Impact Spread Damage Shaders.

It assumes that position is somewhere on the chunk and looks for nearest chunk to this position and damages it. Then it does breadth-first support graph traversal. For radial falloff metric distance is measured along the edges of the graph. That allows to avoid damaging parts which are near in space but disjointed topologically. For example if you hit one column of an arc it would take much bigger radius for damage to travel to the other column than in the simple radial damage.

Shader is designed to be used with impact damage, where it is know in advance that actual hit happened.

This shader requires NvBlastExtDamageAccelerator passed in, it request scratch memory from it, therefore it is also designed to work only in single threaded mode. It can easily be changed by passing scratch memory as a part of NvBlastExtProgramParams if required.

NOTE: The signature of shader functions are equal to NvBlastGraphShaderFunction and NvBlastSubgraphShaderFunction respectively. They are not expected to be called directly.

See also:
  NvBlastGraphShaderFunction, NvBlastSubgraphShaderFunction

NVBLAST_API void NvBlastExtImpactSpreadSubgraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastSubgraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

NVBLAST_API void NvBlastExtShearGraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastGraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

Shear Damage Shaders

NOTE: The signature of shader functions are equal to NvBlastGraphShaderFunction and NvBlastSubgraphShaderFunction respectively. They are not expected to be called directly.

See also:
  NvBlastGraphShaderFunction, NvBlastSubgraphShaderFunction

NVBLAST_API void NvBlastExtShearSubgraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastSubgraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

NVBLAST_API void NvBlastExtTriangleIntersectionGraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastGraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |

Triangle Intersection damage for both graph and subgraph shaders.

Every bond is considered to be a segment connecting two chunk centroids. For every bond (segment) intersection with passed triangle is checked. If intersects full damage is applied on bond. For subgraph shader segments are formed as connections between it's subchunks centroids. Intersection is check in the same fashion.

The idea is that if you want to cut an object say with the laser sword, you can form a triangle by taking the position of a sword on this timeframe and on previous one. So that nothing will be missed in terms of space and time. By sweeping sword through whole object it will be cut in halves inevitably, since all bonds segments form connected graph.

NOTE: The signature of shader functions are equal to NvBlastGraphShaderFunction and NvBlastSubgraphShaderFunction respectively. They are not expected to be called directly.

See also:
  NvBlastGraphShaderFunction, NvBlastSubgraphShaderFunction

NVBLAST_API void NvBlastExtTriangleIntersectionSubgraphShader | ( | NvBlastFractureBuffers * | commandBuffers,
|  | const NvBlastSubgraphShaderActor * | actor,
|  | const void * | params |
| ) |  |  |