Search in sources :

Example 1 with TechniqueDefLogic

use of com.jme3.material.logic.TechniqueDefLogic in project jmonkeyengine by jMonkeyEngine.

the class Technique method makeCurrent.

/**
     * Called by the material to determine which shader to use for rendering.
     * 
     * The {@link TechniqueDefLogic} is used to determine the shader to use
     * based on the {@link LightMode}.
     * 
     * @param renderManager The render manager for which the shader is to be selected.
     * @param rendererCaps The renderer capabilities which the shader should support.
     * @return A compatible shader.
     */
Shader makeCurrent(RenderManager renderManager, SafeArrayList<MatParamOverride> worldOverrides, SafeArrayList<MatParamOverride> forcedOverrides, LightList lights, EnumSet<Caps> rendererCaps) {
    TechniqueDefLogic logic = def.getLogic();
    AssetManager assetManager = owner.getMaterialDef().getAssetManager();
    dynamicDefines.clear();
    dynamicDefines.setAll(paramDefines);
    if (worldOverrides != null) {
        applyOverrides(dynamicDefines, worldOverrides);
    }
    if (forcedOverrides != null) {
        applyOverrides(dynamicDefines, forcedOverrides);
    }
    return logic.makeCurrent(assetManager, renderManager, rendererCaps, lights, dynamicDefines);
}
Also used : AssetManager(com.jme3.asset.AssetManager) TechniqueDefLogic(com.jme3.material.logic.TechniqueDefLogic)

Example 2 with TechniqueDefLogic

use of com.jme3.material.logic.TechniqueDefLogic in project jmonkeyengine by jMonkeyEngine.

the class Technique method render.

/**
     * Render the technique according to its {@link TechniqueDefLogic}.
     * 
     * @param renderManager The render manager to perform the rendering against.
     * @param shader The shader that was selected in 
     * {@link #makeCurrent(com.jme3.renderer.RenderManager, java.util.EnumSet)}.
     * @param geometry The geometry to render
     * @param lights Lights which influence the geometry.
     */
void render(RenderManager renderManager, Shader shader, Geometry geometry, LightList lights, int lastTexUnit) {
    TechniqueDefLogic logic = def.getLogic();
    logic.render(renderManager, shader, geometry, lights, lastTexUnit);
}
Also used : TechniqueDefLogic(com.jme3.material.logic.TechniqueDefLogic)

Aggregations

TechniqueDefLogic (com.jme3.material.logic.TechniqueDefLogic)2 AssetManager (com.jme3.asset.AssetManager)1