×
Menu

Clipped Projected Texture Usage (EN)

 

 Выдержка из оригинальной справки. (NDL Gamebryo 1.1)
 
Generally, applications using clipped projected textures will set the plane such that is includes the center of projection of the effect, and such that the plane normal points in the projection direction. This ensures that all points "behind" the effect are not illuminated (or shadowed) by the effect. Furthermore, since the plane is defined to be in the model space of the effect, applications that move their projected effects by changing the effect's Object scale, rotation and translation (which is common) will not need to adjust the plane again. It will simply "follow" the effect. The default plane is [1,0,0] + k=0. This is the plane through the model-space origin whose normal is the model-space X-axis.
 
As a concrete example, an application using the parallel or perspective projections listed above can use the default plane, as in both cases the center of projection is the model-space origin, and the direction of projection is the positive model-space X-axis.
 
Еще выдержка из оригинальной справки. (NDL Gamebryo 1.1)
 
Developers using projected textures may discover an unexpected (and perhaps undesirable) side effect: parallel and perspective projected texture projections are bi-directional. That is, the textures are projected infinitely in both directions. For example, a projected spotlight effect that is applied to an entire room will produce a circle of light on two walls — the wall that is directly in front of the projection, and the wall that is directly behind it. This is because the mathematics of projection is bi-directional.
 
One may ask the question, "if projection is bi-directional, then why don't we see objects that are behind us in a camera projection? The reason that we do not see objects behind us in a standard camera projection is near-plane clipping. Objects behind the camera are clipped (or culled) away before projection.
 
A similar type of effect can be used to make Gamebryo projected lights and projected shadows "clip" away parts of the affected scene, so that they are not affected. We use the term "clipping" in quotes because the effect is achieved through a clever use of multitexture hardware, and does not actually require any polygons to be clipped. This is good, as clipping of any kind can be an expensive operation.
 
The feature allows applications to specify a plane in the model space of the NiTextureEffect. Sections of affected objects that are on the positive side of the plane will receive the effect, while parts of objects on the negative side will not. This is a per-pixel operation, not a per-polygon or per-object operation. If a single polygon spans both the positive and negative side of the plane, the two parts of the polygon will be affected differently.