use of io.xol.chunkstories.api.rendering.RenderingInterface in project chunkstories-core by Hugobros3.
the class ParticleFireLight method getRenderer.
@Override
public ParticleTypeRenderer getRenderer(ParticlesRenderer particlesRenderer) {
return new ParticleTypeRenderer(particlesRenderer) {
@Override
public void beginRenderingForType(RenderingInterface renderingContext) {
super.beginRenderingForType(renderingContext);
renderingContext.setBlendMode(BlendMode.PREMULT_ALPHA);
renderingContext.getRenderTargetManager().setDepthMask(false);
// renderingContext.setDepthTestMode(DepthTestMode.DISABLED);
// System.out.println("k");
String temp_scale = "./textures/particles/fire_temp_scale_expl.png";
renderingContext.bindTexture2D("colorTempSampler", particlesRenderer.getContent().textures().getTexture(temp_scale));
particlesRenderer.getContent().textures().getTexture(temp_scale).setLinearFiltering(true);
particlesRenderer.getContent().textures().getTexture(temp_scale).setTextureWrapping(false);
getAlbedoTexture().setMipMapping(true);
getAlbedoTexture().setLinearFiltering(true);
getAlbedoTexture().setTextureWrapping(false);
}
@Override
public void forEach_Rendering(RenderingInterface renderingContext, ParticleData data) {
ParticleFireData b = (ParticleFireData) data;
renderingContext.getLightsRenderer().queueLight(new Light(new Vector3f(1.0f, 252f / 255f, 1 / 255f), new Vector3f((float) data.x(), (float) data.y(), (float) data.z()), 25f * Math2.clamp((float) (double) b.vel.x() * 5000, 0.0, 1.0)));
// System.out.println("k");
/*data.setY((float) (data.y() + (Math.random() - 0.1) * 0.0015));
data.setX((float) (data.x() + (Math.random() - 0.5) * 0.0015));
data.setZ((float) (data.z() + (Math.random() - 0.5) * 0.0015));
*/
((ParticleFireData) data).timer--;
if (((ParticleFireData) data).timer < 0)
data.destroy();
}
@Override
public void destroy() {
}
};
}
use of io.xol.chunkstories.api.rendering.RenderingInterface in project chunkstories-core by Hugobros3.
the class ParticleLightningStrike method getRenderer.
@Override
public ParticleTypeRenderer getRenderer(ParticlesRenderer particlesRenderer) {
return new ParticleTypeRenderer(particlesRenderer) {
@Override
public void forEach_Rendering(RenderingInterface renderingContext, ParticleData data) {
Content content = ParticleLightningStrike.this.getType().store().parent();
if (content instanceof ClientContent) {
ClientContent clientContent = (ClientContent) content;
LocalPlayer player = clientContent.getContext().getPlayer();
Entity entity = player.getControlledEntity();
if (entity != null) {
Location loc = entity.getLocation();
data.set((float) (double) data.x(), (float) (double) loc.y() + 1024, (float) (double) data.z());
}
}
renderingContext.getLightsRenderer().queueLight(new Light(new Vector3f(226 / 255f, 255 / 255f, 226 / 255f).mul((float) (1f + Math.random())), new Vector3f((float) data.x(), (float) data.y(), (float) data.z()), 102004f + (float) Math.random() * 5f));
}
@Override
public void destroy() {
}
};
}
use of io.xol.chunkstories.api.rendering.RenderingInterface in project chunkstories-core by Hugobros3.
the class ParticleLight method getRenderer.
@Override
public ParticleTypeRenderer getRenderer(ParticlesRenderer particlesRenderer) {
return new ParticleTypeRenderer(particlesRenderer) {
@Override
public void forEach_Rendering(RenderingInterface renderingContext, ParticleData data2) {
ParticleLightData data = (ParticleLightData) data2;
renderingContext.getLightsRenderer().queueLight(new Light(new Vector3f(1.0f, 181f / 255f, 79 / 255f), new Vector3f((float) data.c.x(), (float) data.c.y(), (float) data.c.z()), 15f + (float) Math.random() * 5f));
}
@Override
public void destroy() {
}
};
}
Aggregations