use of com.talosvfx.talos.runtime.render.drawables.ShadedDrawable 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.ShadedDrawable in project talos by rockbite.
the class ShadedSpriteModule method updateShader.
private void updateShader(ShaderDescriptor shaderDescriptor) {
this.shaderDescriptor = shaderDescriptor;
if (shaderDescriptor != null) {
ShadedDrawable drawable = (ShadedDrawable) outputValue.getDrawable();
drawable.setShader(shaderDescriptor.getFragCode());
for (String uniformName : shaderDescriptor.getUniformMap().keys()) {
ShaderDescriptor.UniformData data = shaderDescriptor.getUniformMap().get(uniformName);
if (data.type == ShaderDescriptor.Type.TEXTURE) {
TextureRegion textureRegion = graph.getEffectDescriptor().getAssetProvider().findAsset(data.payload, TextureRegion.class);
textureMap.put(uniformName, textureRegion);
}
}
drawable.setTextures(textureMap);
}
}
use of com.talosvfx.talos.runtime.render.drawables.ShadedDrawable in project talos by rockbite.
the class ShadedSpriteModule method defineSlots.
@Override
protected void defineSlots() {
outputValue = (DrawableValue) createOutputSlot(OUTPUT, new DrawableValue());
outputValue.setDrawable(new ShadedDrawable());
}
Aggregations