Package com.jme3.material.logic
Class SinglePassLightingLogic
java.lang.Object
com.jme3.material.logic.DefaultTechniqueDefLogic
com.jme3.material.logic.SinglePassLightingLogic
- All Implemented Interfaces:
- TechniqueDefLogic
- 
Field SummaryFields inherited from class com.jme3.material.logic.DefaultTechniqueDefLogictechniqueDef
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionmakeCurrent(AssetManager assetManager, RenderManager renderManager, EnumSet<Caps> rendererCaps, LightList lights, DefineList defines) Determine the shader to use for the given geometry / material combination.voidrender(RenderManager renderManager, Shader shader, Geometry geometry, LightList lights, Material.BindUnits lastBindUnits) Requests that theTechniqueDefLogicrenders the given geometry.protected intupdateLightListUniforms(Shader shader, Geometry g, LightList lightList, int numLights, RenderManager rm, int startIndex) Uploads the lights in the light list as two uniform arrays.Methods inherited from class com.jme3.material.logic.DefaultTechniqueDefLogicgetAmbientColor, renderMeshFromGeometry
- 
Constructor Details- 
SinglePassLightingLogic
 
- 
- 
Method Details- 
makeCurrentpublic Shader makeCurrent(AssetManager assetManager, RenderManager renderManager, EnumSet<Caps> rendererCaps, LightList lights, DefineList defines) Description copied from interface:TechniqueDefLogicDetermine the shader to use for the given geometry / material combination.- Specified by:
- makeCurrentin interface- TechniqueDefLogic
- Overrides:
- makeCurrentin class- DefaultTechniqueDefLogic
- Parameters:
- assetManager- The asset manager to use for loading shader source code, shader nodes, and lookup textures.
- renderManager- The render manager for which rendering is to be performed.
- rendererCaps- Renderer capabilities. The returned shader must support these capabilities.
- lights- The lights with which the geometry shall be rendered. This list must not include culled lights.
- defines- The define list used by the technique, any- unmapped definesshould be set here to change shader behavior.
- Returns:
- The shader to use for rendering.
 
- 
updateLightListUniformsprotected int updateLightListUniforms(Shader shader, Geometry g, LightList lightList, int numLights, RenderManager rm, int startIndex) Uploads the lights in the light list as two uniform arrays.uniform vec4 g_LightColor[numLights];
 // g_LightColor.rgb is the diffuse/specular color of the light.
 // g_LightColor.a is the type of light, 0 = Directional, 1 = Point,
 // 2 = Spot.
 
 uniform vec4 g_LightPosition[numLights];
 // g_LightPosition.xyz is the position of the light (for point lights)
 // or the direction of the light (for directional lights).
 // g_LightPosition.w is the inverse radius (1/r) of the light (for attenuation)- Parameters:
- shader- the Shader being used
- g- the Geometry being rendered
- lightList- the list of lights
- numLights- the number of lights to upload
- rm- to manage rendering
- startIndex- the starting index in the LightList
- Returns:
- the next starting index in the LightList
 
- 
renderpublic void render(RenderManager renderManager, Shader shader, Geometry geometry, LightList lights, Material.BindUnits lastBindUnits) Description copied from interface:TechniqueDefLogicRequests that theTechniqueDefLogicrenders the given geometry. Fixed material functionality such asRenderState,material parameters, anduniform bindingshave already been applied by the material, however,RenderState,uniforms,textures, can still be overridden.- Specified by:
- renderin interface- TechniqueDefLogic
- Overrides:
- renderin class- DefaultTechniqueDefLogic
- Parameters:
- renderManager- The render manager to perform the rendering against.
- shader- The shader that was selected by this logic in- TechniqueDefLogic.makeCurrent(com.jme3.asset.AssetManager, com.jme3.renderer.RenderManager, java.util.EnumSet, com.jme3.light.LightList, com.jme3.shader.DefineList).
- geometry- The geometry to render
- lights- Lights which influence the geometry.
 
 
-