NvBlastExtMaterial

Defined in extensions/shaders/NvBlastExtDamageShaders.h

Functions

Variables

  • health: health

  • maxDamageThreshold: max damage fraction threshold to be applied. Range [0, 1]. For example 0.8 won't allow more then 80% of health damage to be applied.

  • minDamageThreshold: min damage fraction threshold to be applied. Range [0, 1]. For example 0.1 filters all damage below 10% of health.

struct NvBlastExtMaterial

Example of simple material.

It is passed into damage shader, thus it is not used currently in any of them. The user can use it to filter and normalize before applying.

Material function implementers may choose their own set.

Public Functions

inline NvBlastExtMaterial()
inline float getNormalizedDamage(float damageInHealth) const

Helper to normalize damage.

Pass damage defined in health, damage in range [0, 1] is returned, where 0 basically indicates that the threshold wasn’t reached and there is no point in applying it.

Parameters

damageInHealth[in] Damage defined in terms of health amount to be reduced.

Returns

normalized damage

Public Members

float health

health

float minDamageThreshold

min damage fraction threshold to be applied. Range [0, 1]. For example 0.1 filters all damage below 10% of health.

float maxDamageThreshold

max damage fraction threshold to be applied. Range [0, 1]. For example 0.8 won’t allow more then 80% of health damage to be applied.