Package com.jme3.shadow
Class SpotLightShadowRenderer
java.lang.Object
com.jme3.shadow.AbstractShadowRenderer
com.jme3.shadow.SpotLightShadowRenderer
- All Implemented Interfaces:
Savable,SceneProcessor,JmeCloneable,Cloneable
SpotLightShadowRenderer renderer use Parallel Split Shadow Mapping technique
(pssm)
It splits the view frustum in several parts and compute a shadow map for each one.
splits are distributed so that the closer they are from the camera, the smaller they are to maximize the resolution used of the shadow map.
This results in a better quality shadow than standard shadow mapping.
for more information on this read http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
It splits the view frustum in several parts and compute a shadow map for each one.
splits are distributed so that the closer they are from the camera, the smaller they are to maximize the resolution used of the shadow map.
This results in a better quality shadow than standard shadow mapping.
for more information on this read http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
-
Field Summary
FieldsFields inherited from class com.jme3.shadow.AbstractShadowRenderer
assetManager, debug, dispPic, dummyTex, edgeFilteringMode, edgesThickness, fadeInfo, fadeLength, forcedRenderState, frustumCam, lightReceivers, lightViewProjectionsMatrices, logger, matCache, nbShadowMaps, needsfallBackMaterial, postshadowMat, postTechniqueName, preshadowMat, prof, renderBackFacesShadows, renderManager, shadowCompareMode, shadowFB, shadowIntensity, shadowMapOccluders, shadowMaps, shadowMapSize, skipPostPass, viewPort, zFarOverride -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUsed for serialization use SpotLightShadowRenderer#SpotLightShadowRenderer(AssetManager assetManager, int shadowMapSize)SpotLightShadowRenderer(AssetManager assetManager, int shadowMapSize) Create a SpotLightShadowRenderer This use standard shadow mapping -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckCulling(Camera viewCam) protected voidclearMaterialParameters(Material material) This method is called once per frame and is responsible for clearing any material parameters that subclasses may need to clear on the post material.voidcloneFields(Cloner cloner, Object original) Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner.protected voiddoDisplayFrustumDebug(int shadowMapIndex) responsible for displaying the frustum of the shadow cam for debug purposegetLight()return the light used to cast shadowsprotected GeometryListgetOccludersToRender(int shadowMapIndex, GeometryList shadowMapOccluders) Returns a subclass-specific geometryList containing the occluders to be rendered in the shadow mapprotected voidgetReceivers(GeometryList lightReceivers) protected CameragetShadowCam(int shadowMapIndex) return the shadow camera to use for rendering the shadow map according the given indexprotected voiddelegates the initialization of the frustum cam to child renderersvoidread(JmeImporter im) De-serialize this instance, for example when loading from a J3O file.voidSets the light to use to cast shadowsprotected voidsetMaterialParameters(Material material) This method is called once per frame and is responsible for setting any material parameters that subclasses may need to set on the post material.protected voidupdateShadowCams(Camera viewCam) Invoked once per frame to update the shadow cams according to the light view.voidwrite(JmeExporter ex) Serialize this instance, for example when saving to a J3O file.Methods inherited from class com.jme3.shadow.AbstractShadowRenderer
cleanup, createFrustum, displayDebug, displayFrustum, displayShadowMap, getEdgeFilteringMode, getEdgesThickness, getNumShadowMaps, getPreShadowForcedRenderState, getShadowCompareMode, getShadowIntensity, getShadowMapSize, getShadowZExtend, getShadowZFadeLength, initForcedRenderState, initialize, isFlushQueues, isInitialized, isRenderBackFacesShadows, jmeClone, postFrame, postQueue, preFrame, renderShadowMap, reshape, setEdgeFilteringMode, setEdgesThickness, setPostShadowMaterial, setPostShadowParams, setProfiler, setRenderBackFacesShadows, setShadowCompareMode, setShadowIntensity, setShadowZExtend, setShadowZFadeLengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.post.SceneProcessor
rescale
-
Field Details
-
shadowCam
-
light
-
points
-
-
Constructor Details
-
SpotLightShadowRenderer
protected SpotLightShadowRenderer()Used for serialization use SpotLightShadowRenderer#SpotLightShadowRenderer(AssetManager assetManager, int shadowMapSize) -
SpotLightShadowRenderer
Create a SpotLightShadowRenderer This use standard shadow mapping- Parameters:
assetManager- the application asset managershadowMapSize- the size of the rendered shadowmaps (512,1024,2048, etc...) The more quality, the fewer fps.
-
-
Method Details
-
initFrustumCam
protected void initFrustumCam()Description copied from class:AbstractShadowRendererdelegates the initialization of the frustum cam to child renderers- Specified by:
initFrustumCamin classAbstractShadowRenderer
-
getLight
return the light used to cast shadows- Returns:
- the SpotLight
-
setLight
Sets the light to use to cast shadows- Parameters:
light- a SpotLight
-
updateShadowCams
Description copied from class:AbstractShadowRendererInvoked once per frame to update the shadow cams according to the light view.- Specified by:
updateShadowCamsin classAbstractShadowRenderer- Parameters:
viewCam- the scene cam
-
getOccludersToRender
Description copied from class:AbstractShadowRendererReturns a subclass-specific geometryList containing the occluders to be rendered in the shadow map- Specified by:
getOccludersToRenderin classAbstractShadowRenderer- Parameters:
shadowMapIndex- the index of the shadow map being renderedshadowMapOccluders- the list of occluders- Returns:
- the geometryList
-
getReceivers
- Specified by:
getReceiversin classAbstractShadowRenderer
-
getShadowCam
Description copied from class:AbstractShadowRendererreturn the shadow camera to use for rendering the shadow map according the given index- Specified by:
getShadowCamin classAbstractShadowRenderer- Parameters:
shadowMapIndex- the index of the shadow map being rendered- Returns:
- the shadowCam
-
doDisplayFrustumDebug
protected void doDisplayFrustumDebug(int shadowMapIndex) Description copied from class:AbstractShadowRendererresponsible for displaying the frustum of the shadow cam for debug purpose- Overrides:
doDisplayFrustumDebugin classAbstractShadowRenderer- Parameters:
shadowMapIndex- the index of the shadow map
-
setMaterialParameters
Description copied from class:AbstractShadowRendererThis method is called once per frame and is responsible for setting any material parameters that subclasses may need to set on the post material.- Specified by:
setMaterialParametersin classAbstractShadowRenderer- Parameters:
material- the material to use for the post shadow pass
-
clearMaterialParameters
Description copied from class:AbstractShadowRendererThis method is called once per frame and is responsible for clearing any material parameters that subclasses may need to clear on the post material.- Specified by:
clearMaterialParametersin classAbstractShadowRenderer- Parameters:
material- the material that was used for the post shadow pass
-
cloneFields
Description copied from interface:JmeCloneableImplemented to perform deep cloning for this object, resolving local cloned references using the specified cloner. The object can call cloner.clone(fieldValue) to deep clone any of its fields.Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
- Specified by:
cloneFieldsin interfaceJmeCloneable- Overrides:
cloneFieldsin classAbstractShadowRenderer- Parameters:
cloner- The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.original- The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
-
read
Description copied from class:AbstractShadowRendererDe-serialize this instance, for example when loading from a J3O file.- Specified by:
readin interfaceSavable- Overrides:
readin classAbstractShadowRenderer- Parameters:
im- importer (not null)- Throws:
IOException- from the importer
-
write
Description copied from class:AbstractShadowRendererSerialize this instance, for example when saving to a J3O file.- Specified by:
writein interfaceSavable- Overrides:
writein classAbstractShadowRenderer- Parameters:
ex- exporter (not null)- Throws:
IOException- from the exporter
-
checkCulling
- Specified by:
checkCullingin classAbstractShadowRenderer- Parameters:
viewCam- the viewing Camera to check against- Returns:
- true if intersects, otherwise false
-