UDN
Search public documentation:
DevelopmentKitGemsRenderingOccludedActors
日本語訳
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
UE3 Home > Unreal Development Kit Gems > Rendering Occluded Actors
UE3 Home > Materials & Textures > Rendering Occluded Actors
UE3 Home > Materials & Textures > Rendering Occluded Actors
Rendering Occluded Actors
Last tested against UDK Mar, 2011
PC compatible
Overview
Material
- Render the actor's mesh as per normal
- Render an occluded version of the actor's mesh on top; for each pixel
- Check the new pixel depth against the existing pixel depth
- If the difference in depth is above a value, then continue to render the occluded pixel
- Otherwise do not render the pixel
Material properties
In order to have access to the Scene Depth node in the material, the material must be Translucent. Set the material to Unlit to help with performance.
Related topics
- Materials Tutorial
- Materials Compendium
- Material Basics
- Post Process Materials
- Material Instance Constant
- Material Examples
Example
class OccludedPawn extends UTPawn;
var(Pawn) const SkeletalMeshComponent OccludedMesh;
simulated function SetMeshVisibility(bool bVisible)
{
Super.SetMeshVisibility(bVisible);
if (OccludedMesh != None)
{
OccludedMesh.SetOwnerNoSee(!bVisible);
}
}
simulated function SetCharacterMeshInfo(SkeletalMesh SkelMesh, MaterialInterface HeadMaterial, MaterialInterface BodyMaterial)
{
Super.SetCharacterMeshInfo(SkelMesh, HeadMaterial, BodyMaterial);
if (OccludedMesh != None)
{
OccludedMesh.SetSkeletalMesh(SkelMesh);
}
}
defaultproperties
{
Begin Object Class=SkeletalMeshComponent Name=OPawnSkeletalMeshComponent
Materials(0)=Material'OccludedPawnContent.OccludedMaterial'
Materials(1)=Material'OccludedPawnContent.OccludedMaterial'
DepthPriorityGroup=SDPG_Foreground // Render the occluded skeletal mesh in the foreground layer
ShadowParent=WPawnSkeletalMeshComponent
ParentAnimComponent=WPawnSkeletalMeshComponent
bCacheAnimSequenceNodes=false
AlwaysLoadOnClient=true
AlwaysLoadOnServer=true
bOwnerNoSee=true
CastShadow=false // Casting shadows is not required
BlockRigidBody=true
bUpdateSkelWhenNotRendered=false
bIgnoreControllersWhenNotRendered=true
bUpdateKinematicBonesFromAnimation=true
bCastDynamicShadow=false // Casting shadows is not required
RBChannel=RBCC_Untitled3
RBCollideWithChannels=(Untitled3=true)
LightEnvironment=MyLightEnvironment
bOverrideAttachmentOwnerVisibility=true
bAcceptsDynamicDecals=false
bHasPhysicsAssetInstance=true
TickGroup=TG_PreAsyncWork
MinDistFactorForKinematicUpdate=0.2f
bChartDistanceFactor=true
RBDominanceGroup=20
MotionBlurScale=0.f
bUseOnePassLightingOnTranslucency=true
bPerBoneMotionBlur=true
End Object
OccludedMesh=OPawnSkeletalMeshComponent
Components.Add(OPawnSkeletalMeshComponent)
CamOffset=(X=16.0,Y=64.0,Z=-52.0)
}
class OccludedGameInfo extends UTDeathmatch;
defaultproperties
{
DefaultPawnClass=class'OccludedPawn'
}
Related topics
Limitations
Downloads
- Download the source and content used in this gem. (OccludedPawn.zip)
