use of com.talosvfx.talos.runtime.render.drawables.RibbonRenderer in project talos by rockbite.
the class RibbonModule method defineSlots.
@Override
protected void defineSlots() {
mainDrawableValue = (DrawableValue) createInputSlot(MAIN_REGION, new DrawableValue());
ribbonDrawableValue = (DrawableValue) createInputSlot(RIBBON_REGION, new DrawableValue());
thicknessValue = createInputSlot(THICKNESS);
transparencyValue = createInputSlot(TRANSPARENCY);
colorValue = createInputSlot(COLOR);
RibbonRenderer renderer = new RibbonRenderer();
outputValue = (DrawableValue) createOutputSlot(OUTPUT, new DrawableValue());
outputValue.setDrawable(renderer);
}
use of com.talosvfx.talos.runtime.render.drawables.RibbonRenderer in project talos by rockbite.
the class RibbonModule method setDetailCount.
public void setDetailCount(int count) {
detail = count;
RibbonRenderer renderer = (RibbonRenderer) outputValue.getDrawable();
renderer.setConfig(detail, memoryDuration);
}
use of com.talosvfx.talos.runtime.render.drawables.RibbonRenderer in project talos by rockbite.
the class RibbonModule method setMemoryDuration.
public void setMemoryDuration(float duration) {
memoryDuration = duration;
RibbonRenderer renderer = (RibbonRenderer) outputValue.getDrawable();
renderer.setConfig(detail, memoryDuration);
}
use of com.talosvfx.talos.runtime.render.drawables.RibbonRenderer in project talos by rockbite.
the class RibbonModule method processValues.
@Override
public void processValues() {
RibbonRenderer renderer = (RibbonRenderer) outputValue.getDrawable();
TextureRegion mainRegion = null;
TextureRegion ribbonRegion = null;
if (!mainDrawableValue.isEmpty() && mainDrawableValue.getDrawable() != null) {
mainRegion = mainDrawableValue.getDrawable().getTextureRegion();
}
if (!ribbonDrawableValue.isEmpty() && ribbonDrawableValue.getDrawable() != null) {
if (ribbonDrawableValue.getDrawable() instanceof TextureRegionDrawable) {
ribbonRegion = ribbonDrawableValue.getDrawable().getTextureRegion();
} else if (ribbonDrawableValue.getDrawable() instanceof ShadedDrawable) {
renderer.setShadedDrawable((ShadedDrawable) ribbonDrawableValue.getDrawable());
}
}
renderer.setRegions(mainRegion, ribbonRegion);
}
use of com.talosvfx.talos.runtime.render.drawables.RibbonRenderer in project talos by rockbite.
the class RibbonModule method fetchAllInputSlotValues.
@Override
public void fetchAllInputSlotValues() {
super.fetchAllInputSlotValues();
float requester = getScope().get(ScopePayload.REQUESTER_ID).getFloat();
RibbonRenderer renderer = (RibbonRenderer) outputValue.getDrawable();
renderer.setCurrentParticle(getScope().currParticle());
for (int i = 0; i < detail; i++) {
float pointAlpha = (float) i / (detail - 1);
if (pointAlpha == 0)
pointAlpha = 0.001f;
getScope().set(ScopePayload.SECONDARY_SEED, pointAlpha);
getScope().set(ScopePayload.REQUESTER_ID, requester + pointAlpha * 0.1f);
for (Slot inputSlot : inputSlots.values()) {
fetchInputSlotValue(inputSlot.getIndex());
}
float transparencyVal = 1f;
if (!transparencyValue.isEmpty()) {
transparencyVal = transparencyValue.getFloat();
}
if (colorValue.isEmpty()) {
tmpColor.set(Color.WHITE);
tmpColor.a = transparencyVal;
} else {
tmpColor.set(colorValue.get(0), colorValue.get(1), colorValue.get(2), transparencyVal);
}
float thicknessVal = 0.1f;
if (!thicknessValue.isEmpty()) {
thicknessVal = thicknessValue.getFloat();
}
renderer.setPointData(i, thicknessVal, tmpColor);
}
// renderer.adjustPointData();
getScope().set(ScopePayload.REQUESTER_ID, requester);
}
Aggregations