use of hellfirepvp.astralsorcery.client.resource.SpriteSheetResource in project AstralSorcery by HellFirePvP.
the class FXLightbeam method renderCurrentTextureAroundAxis.
private <T extends EntityVisualFX> void renderCurrentTextureAroundAxis(IVertexBuilder vb, MatrixStack renderStack, BatchRenderContext<T> ctx, Vector3 renderOffset, double angle, float scale, int r, int g, int b, int a) {
Vector3 perp = aimPerp.clone().rotate(angle, aim).normalize();
Vector3 perpTo = perp.clone().multiply(toSize * scale);
Vector3 perpFrom = perp.multiply(fromSize * scale);
SpriteSheetResource ssr = ctx.getSprite();
Tuple<Float, Float> uvOffset = ssr.getUVOffset(age);
float u = uvOffset.getA();
float v = uvOffset.getB();
float uWidth = ssr.getULength();
float vHeight = ssr.getVLength();
Matrix4f matr = renderStack.getLast().getMatrix();
Vector3 vec = to.clone().add(perpTo.clone().multiply(-1)).subtract(renderOffset);
vec.drawPos(matr, vb).color(r, g, b, a).tex(u, v + vHeight).endVertex();
vec = to.clone().add(perpTo).subtract(renderOffset);
vec.drawPos(matr, vb).color(r, g, b, a).tex(u + uWidth, v + vHeight).endVertex();
vec = from.clone().add(perpFrom).subtract(renderOffset);
vec.drawPos(matr, vb).color(r, g, b, a).tex(u + uWidth, v).endVertex();
vec = from.clone().add(perpFrom.clone().multiply(-1)).subtract(renderOffset);
vec.drawPos(matr, vb).color(r, g, b, a).tex(u, v).endVertex();
}
use of hellfirepvp.astralsorcery.client.resource.SpriteSheetResource in project AstralSorcery by HellFirePvP.
the class ScreenJournalPerkTree method drawSearchHalo.
private void drawSearchHalo(BatchPerkContext ctx, MatrixStack renderStack, float size, float x, float y) {
BufferContext batch = ctx.getContext(searchContext);
SpriteSheetResource searchMark = SpritesAS.SPR_PERK_SEARCH;
searchMark.bindTexture();
Vector3 starVec = new Vector3(x - size, y - size, 0);
float uLength = searchMark.getUWidth();
float vLength = searchMark.getVWidth();
Tuple<Float, Float> frameUV = searchMark.getUVOffset();
Matrix4f offset = renderStack.getLast().getMatrix();
for (int i = 0; i < 4; i++) {
int u = ((i + 1) & 2) >> 1;
int v = ((i + 2) & 2) >> 1;
Vector3 pos = starVec.clone().addX(size * u * 2).addY(size * v * 2);
pos.drawPos(offset, batch).color(0.8F, 0.1F, 0.1F, 1F).tex(frameUV.getA() + uLength * u, frameUV.getB() + vLength * v).endVertex();
}
}
use of hellfirepvp.astralsorcery.client.resource.SpriteSheetResource in project AstralSorcery by HellFirePvP.
the class ScreenJournalPerkTree method drawSeal.
private void drawSeal(BufferBuilder vb, MatrixStack renderStack, double size, double x, double y, long spriteOffsetTick, float alpha) {
SpriteSheetResource tex = SpritesAS.SPR_PERK_SEAL;
if (tex == null) {
return;
}
float uLength = tex.getULength();
float vLength = tex.getVLength();
Tuple<Float, Float> frameUV = tex.getUVOffset(spriteOffsetTick);
Vector3 starVec = new Vector3(x - size, y - size, 0);
Matrix4f offset = renderStack.getLast().getMatrix();
for (int i = 0; i < 4; i++) {
int u = ((i + 1) & 2) >> 1;
int v = ((i + 2) & 2) >> 1;
Vector3 pos = starVec.clone().addX(size * u * 2).addY(size * v * 2);
pos.drawPos(offset, vb).color(1F, 1F, 1F, alpha).tex(frameUV.getA() + uLength * u, frameUV.getB() + vLength * v).endVertex();
}
}
use of hellfirepvp.astralsorcery.client.resource.SpriteSheetResource in project AstralSorcery by HellFirePvP.
the class EffectCustomTexture method renderInventoryEffect.
@Override
@OnlyIn(Dist.CLIENT)
public void renderInventoryEffect(EffectInstance effect, DisplayEffectsScreen<?> gui, MatrixStack renderStack, int x, int y, float z) {
float wh = 18;
float offsetX = x + 6;
float offsetY = y + 7;
float red = ((float) this.colorAsObj.getRed()) / 255F;
float green = ((float) this.colorAsObj.getGreen()) / 255F;
float blue = ((float) this.colorAsObj.getBlue()) / 255F;
SpriteSheetResource ssr = getSpriteQuery().resolveSprite();
ssr.bindTexture();
Tuple<Float, Float> uvTpl = ssr.getUVOffset(ClientScheduler.getClientTick());
RenderingUtils.draw(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR_TEX, buf -> {
RenderingGuiUtils.rect(buf, renderStack, offsetX, offsetY, z, wh, wh).color(red, green, blue, 1F).tex(uvTpl.getA(), uvTpl.getB(), ssr.getUWidth(), ssr.getVWidth()).draw();
});
}
use of hellfirepvp.astralsorcery.client.resource.SpriteSheetResource in project AstralSorcery by HellFirePvP.
the class RegistrySprites method loadSprites.
public static void loadSprites() {
SPR_CRYSTAL_EFFECT_1 = new SpriteSheetResource(TEX_CRYSTAL_EFFECT_1, 5, 8);
SPR_CRYSTAL_EFFECT_2 = new SpriteSheetResource(TEX_CRYSTAL_EFFECT_2, 5, 8);
SPR_CRYSTAL_EFFECT_3 = new SpriteSheetResource(TEX_CRYSTAL_EFFECT_3, 5, 8);
SPR_GEM_CRYSTAL_BURST = new SpriteSheetResource(TEX_GEM_CRYSTAL_BURST, 5, 8);
SPR_GEM_CRYSTAL_BURST_SKY = new SpriteSheetResource(TEX_GEM_CRYSTAL_BURST_SKY, 5, 8);
SPR_GEM_CRYSTAL_BURST_DAY = new SpriteSheetResource(TEX_GEM_CRYSTAL_BURST_DAY, 5, 8);
SPR_GEM_CRYSTAL_BURST_NIGHT = new SpriteSheetResource(TEX_GEM_CRYSTAL_BURST_NIGHT, 5, 8);
SPR_PERK_INACTIVE = new SpriteSheetResource(TEX_GUI_PERK_INACTIVE, 5, 8);
SPR_PERK_ACTIVE = new SpriteSheetResource(TEX_GUI_PERK_ACTIVE, 5, 8);
SPR_PERK_ACTIVATEABLE = new SpriteSheetResource(TEX_GUI_PERK_ACTIVATEABLE, 5, 8);
SPR_PERK_HALO_INACTIVE = new SpriteSheetResource(TEX_GUI_PERK_HALO_INACTIVE, 4, 8);
SPR_PERK_HALO_ACTIVE = new SpriteSheetResource(TEX_GUI_PERK_HALO_ACTIVE, 4, 8);
SPR_PERK_HALO_ACTIVATEABLE = new SpriteSheetResource(TEX_GUI_PERK_HALO_ACTIVATEABLE, 4, 8);
SPR_PERK_SEARCH = new SpriteSheetResource(TEX_GUI_PERK_SEARCH, 4, 8);
SPR_PERK_SEAL = new SpriteSheetResource(TEX_GUI_PERK_SEAL, 4, 8);
SPR_PERK_SEAL_BREAK = new SpriteSheetResource(TEX_GUI_PERK_SEAL_BREAK, 7, 8);
SPR_PERK_UNLOCK = new SpriteSheetResource(TEX_GUI_PERK_UNLOCK, 5, 16);
SPR_COLLECTOR_EFFECT = new SpriteSheetResource(TEX_COLLECTOR_EFFECT, 5, 16);
SPR_CRAFT_BURST = new SpriteSheetResource(TEX_CRAFT_BURST, 6, 8);
SPR_CRAFT_FLARE = new SpriteSheetResource(TEX_CRAFT_FLARE, 8, 8);
SPR_ATTUNEMENT_FLARE = new SpriteSheetResource(TEX_ATTUNEMENT_FLARE, 6, 8);
SPR_RELAY_FLARE = new SpriteSheetResource(TEX_RELAY_FLARE, 6, 8);
SPR_LIGHTBEAM = new SpriteSheetResource(TEX_LIGHTBEAM, 4, 16);
SPR_LIGHTBEAM_TRANSFER = new SpriteSheetResource(TEX_LIGHTBEAM_TRANSFER, 4, 16);
SPR_ENTITY_FLARE = new SpriteSheetResource(TEX_ENTITY_FLARE, 6, 8);
SPR_GRAPPLING_HOOK = new SpriteSheetResource(TEX_GRAPPLING_HOOK, 4, 8);
SPR_HALO_INFUSION = new SpriteSheetResource(TEX_HALO_INFUSION, 8, 8);
SPR_HALO_RITUAL = new SpriteSheetResource(TEX_HALO_RITUAL, 6, 8);
SPR_FOUNTAIN_LIQUID = new SpriteSheetResource(TEX_FOUNTAIN_LIQUID, 4, 8);
SPR_FOUNTAIN_VORTEX = new SpriteSheetResource(TEX_FOUNTAIN_VORTEX, 5, 8);
SPR_DAZZLING_AURA = new SpriteSheetResource(TEX_DAZZLING_AURA, 4, 4);
SPR_OVERLAY_CHARGE = new SpriteSheetResource(TEX_OVERLAY_CHARGE, 8, 4);
SPR_OVERLAY_CHARGE_COLORLESS = new SpriteSheetResource(TEX_OVERLAY_CHARGE_COLORLESS, 8, 4);
SPR_STARLIGHT_STORE = new SpriteSheetResource(TEX_STARLIGHT_STORE, 16, 4);
}
Aggregations