/** * Enforce a particular state. In other words, the given state will override any state of the same type set on a * scene object. Remember to clear the state when done enforcing. Very useful for multipass techniques where * multiple sets of states need to be applied to a scenegraph drawn multiple times. * * @param state * state to enforce */ public void setPassState(final RenderState state) { _passStates.put(state.getType(), state); }
/** * Sets if this render state is enabled during rendering. Disabled states are ignored. * * @param value * False if the state is to be disabled, true otherwise. */ public void setEnabled(final boolean value) { _enabled = value; setNeedsRefresh(true); }
public AbstractRenderer() { for (final RenderState.StateType type : RenderState.StateType.values()) { final RenderState state = RenderState.createState(type); state.setEnabled(false); defaultStateList.put(type, state); } }
protected void setupRecords() { for (final RenderState.StateType type : RenderState.StateType.values()) { _stateRecords.put(type, RenderState.createState(type).createStateRecord(_capabilities)); } }
@Override public void write(final OutputCapsule capsule) throws IOException { super.write(capsule); capsule.writeSavableList(lightList, "lightList", new ArrayList<Light>()); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _texture = capsule.readSavableList("texture", new ArrayList<Texture>(1)); }
public void applyState(final StateType type, final RenderState state) { if (Constants.stats) { StatCollector.startStat(StatType.STAT_STATES_TIMER); } final RenderState tempState = getProperRenderState(type, state); final RenderContext context = ContextManager.getCurrentContext(); if (!RenderState._quickCompare.contains(type) || tempState.needsRefresh() || tempState != context.getCurrentState(type)) { doApplyState(tempState); tempState.setNeedsRefresh(false); } if (Constants.stats) { StatCollector.endStat(StatType.STAT_STATES_TIMER); } }
@Override public void write(final OutputCapsule capsule) throws IOException { super.write(capsule); capsule.write(_shadeMode, "shadeMode", ShadingMode.Smooth); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); lightList = capsule.readSavableList("lightList", new ArrayList<Light>()); }
public RenderState applyState(final StateType type, final RenderState state) { if (Constants.stats) { StatCollector.startStat(StatType.STAT_STATES_TIMER); } final RenderState tempState = getProperRenderState(type, state); final RenderContext context = ContextManager.getCurrentContext(); if (!RenderState._quickCompare.contains(type) || tempState.needsRefresh() || tempState != context.getCurrentState(type)) { doApplyState(tempState); tempState.setNeedsRefresh(false); } if (Constants.stats) { StatCollector.endStat(StatType.STAT_STATES_TIMER); } return tempState; }
protected void setupRecords() { for (final RenderState.StateType type : RenderState.StateType.values()) { _stateRecords.put(type, RenderState.createState(type).createStateRecord(_capabilities)); } }
/** * Enforce a particular state. In other words, the given state will override any state of the same type set on a * scene object. Remember to clear the state when done enforcing. Very useful for multipass techniques where * multiple sets of states need to be applied to a scenegraph drawn multiple times. * * @param state * state to enforce */ public void enforceState(final RenderState state) { _enforcedStates.put(state.getType(), state); }
/** * Sets if this render state is enabled during rendering. Disabled states are ignored. * * @param value * False if the state is to be disabled, true otherwise. */ public void setEnabled(final boolean value) { _enabled = value; setNeedsRefresh(true); }
@Override public void write(final OutputCapsule capsule) throws IOException { super.write(capsule); capsule.writeSavableList(_texture, "texture", new ArrayList<Texture>(1)); }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); _shadeMode = capsule.readEnum("shadeMode", ShadingMode.class, ShadingMode.Smooth); }
public AbstractRenderer() { _matrixStore.put(RenderMatrixType.Model, BufferUtils.createFloatBuffer(16)); _matrixStore.put(RenderMatrixType.View, BufferUtils.createFloatBuffer(16)); _matrixStore.put(RenderMatrixType.Projection, BufferUtils.createFloatBuffer(16)); _matrixStore.put(RenderMatrixType.Normal, BufferUtils.createFloatBuffer(9)); for (final RenderState.StateType type : RenderState.StateType.values()) { final RenderState state = RenderState.createState(type); state.setEnabled(false); defaultStateList.put(type, state); } }
/** * Enforce a particular state. In other words, the given state will override any state of the same type set on a * scene object. Remember to clear the state when done enforcing. Very useful for multipass techniques where * multiple sets of states need to be applied to a scenegraph drawn multiple times. * * @param state * state to enforce */ public void enforceState(final RenderState state) { _enforcedStates.put(state.getType(), state); }
defaultStateList.get(RenderState.StateType.ZBuffer).setNeedsRefresh(true); doApplyState(defaultStateList.get(RenderState.StateType.ZBuffer));