use of net.minecraft.profiler.Profiler in project BuildCraft by BuildCraft.
the class RenderTickListener method renderMarkerConnector.
private static void renderMarkerConnector(WorldClient world, EntityPlayer player) {
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
profiler.startSection("marker");
for (MarkerCache<?> cache : MarkerCache.CACHES) {
profiler.startSection(cache.name);
renderMarkerCache(player, cache.getSubCache(world));
profiler.endSection();
}
profiler.endSection();
}
use of net.minecraft.profiler.Profiler in project BuildCraft by BuildCraft.
the class RenderTickListener method renderMarkerCache.
private static void renderMarkerCache(EntityPlayer player, MarkerSubCache<?> cache) {
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
profiler.startSection("compute");
Set<LaserData_BC8> toRender = new HashSet<>();
for (final BlockPos a : cache.getAllMarkers()) {
for (final BlockPos b : cache.getValidConnections(a)) {
if (a.toLong() > b.toLong()) {
// Only render each pair once
continue;
}
Vec3d start = VecUtil.convertCenter(a);
Vec3d end = VecUtil.convertCenter(b);
Vec3d startToEnd = end.subtract(start).normalize();
Vec3d endToStart = start.subtract(end).normalize();
start = start.add(VecUtil.scale(startToEnd, 0.125));
end = end.add(VecUtil.scale(endToStart, 0.125));
LaserType laserType = cache.getPossibleLaserType();
if (laserType == null || isLookingAt(a, b, player)) {
laserType = BuildCraftLaserManager.MARKER_DEFAULT_POSSIBLE;
}
LaserData_BC8 data = new LaserData_BC8(laserType, start, end, 1 / 16.0);
toRender.add(data);
}
}
profiler.endStartSection("render");
for (LaserData_BC8 laser : toRender) {
LaserRenderer_BC8.renderLaserStatic(laser);
}
profiler.endSection();
}
use of net.minecraft.profiler.Profiler in project ImmersiveEngineering by BluSunrize.
the class ParticleRenderer method dispatch.
public static void dispatch() {
Profiler profiler = ClientUtils.mc().mcProfiler;
profiler.startSection(ImmersiveEngineering.MODID + "-particles");
boolean isLightingEnabled = GL11.glGetBoolean(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
for (String key : EntityFXIEBase.queuedRenders.keySet()) {
profiler.endStartSection(key);
int i = 0;
// ClientUtils.tes().startDrawingQuads();
for (EntityFXIEBase particle : EntityFXIEBase.queuedRenders.get(key)) {
if ((i++) == 0)
ClientUtils.mc().getTextureManager().bindTexture(particle.getParticleTexture());
// particle.tessellateFromQueue(ClientUtils.tes());
}
// ClientUtils.tes().draw();
}
EntityFXIEBase.queuedRenders.clear();
profiler.startSection("depthIgnoring");
GL11.glDisable(GL11.GL_DEPTH_TEST);
for (String key : EntityFXIEBase.queuedDepthIgnoringRenders.keySet()) {
profiler.endStartSection(key);
int i = 0;
// ClientUtils.tes().startDrawingQuads();
for (EntityFXIEBase particle : EntityFXIEBase.queuedDepthIgnoringRenders.get(key)) {
if ((i++) == 0)
ClientUtils.mc().getTextureManager().bindTexture(particle.getParticleTexture());
// particle.tessellateFromQueue(ClientUtils.tes());
}
// ClientUtils.tes().draw();
}
EntityFXIEBase.queuedDepthIgnoringRenders.clear();
GL11.glEnable(GL11.GL_DEPTH_TEST);
profiler.endSection();
if (!isLightingEnabled)
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
profiler.endSection();
}
use of net.minecraft.profiler.Profiler in project BetterWithAddons by DaedalusGame.
the class ParticleRenderDispatcher method dispatch.
// Called from LightningHandler.onRenderWorldLast since that was
// already registered. /shrug
public static void dispatch() {
Tessellator tessellator = Tessellator.getInstance();
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
//GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
//GlStateManager.depthMask(false);
//GlStateManager.enableBlend();
//GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
//GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);
//GlStateManager.enableLighting();
//profiler.startSection("leaf");
//FXLeafParticle.dispatchQueuedRenders(tessellator);
//profiler.endSection();
//GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
//GlStateManager.disableBlend();
//GlStateManager.depthMask(true);
//GL11.glPopAttrib();
}
use of net.minecraft.profiler.Profiler in project SpongeCommon by SpongePowered.
the class ExperienceHolderUtilsTest method data.
@Parameterized.Parameters
public static Iterable<Object[]> data() {
World world = new World(null, new WorldInfo(new NBTTagCompound()), new WorldProviderSurface(), new Profiler(), false) {
@Override
protected IChunkProvider createChunkProvider() {
return null;
}
@Override
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) {
return false;
}
};
// noinspection EntityConstructor
EntityPlayer player = new EntityPlayer(world, new GameProfile(UUID.randomUUID(), "Player")) {
@Override
public boolean isSpectator() {
return false;
}
@Override
public boolean isCreative() {
return false;
}
};
return () -> new Iterator<Object[]>() {
private int level;
private int startExp;
@Override
public boolean hasNext() {
return level < 50;
}
@Override
public Object[] next() {
player.experienceLevel = level;
Object[] data = { level, startExp, player.xpBarCap() };
startExp += player.xpBarCap();
level++;
return data;
}
};
}
Aggregations