Jump to content

Recommended Posts

Posted

Hey, Im currently tying to get some particles in a mod I'm currently working on. But there are some things I dont understand about it.

 

1. the particle alpha acts pretty wierd. I tried to use "this.setAlphaF()", with some calculations between the brackets. but wether I put it in the "renderParticle" section or the "onUpdate", nothing will happen.

 

2. something wich maybe a partial answer of number 1 is the "getFXLayer()". right now Im using Layer 3 cause it doesnt have a renderer behind it.

But when I render several particles at the same time (at the same place) some will not be visible until the particles in front of it are gone.

I could arange them with the number below 3, but that would influence the vanilla particles as well. so my question is, how can I adjust things like colour and alpha for every single particle? (cause when you change colour on one particle, other will join the party)

 

3. something I noticed is that the particles I made are moving along with the player. when you move towards the left, they will go left with you, till your not moving anymore. than they will return to their original position. something wich vanilla paritcles dont do. also, when I spawn particles at a given position(for example right above a block) they will always have an certain offset. how can I work around both problems?

 

4. currently non of the entityfx has an hitbox I discovered. but I would like to do some eventhandling when players look at a particle. besides I set "canBePushed()" to true, but they wont collide since they dont have an hitbox. I tried to use  "getBoundingBox()" and "setBoundingBox()", but both gave me an error if I returned something else than "this.boudingBox" or "null". so if this can be done, how?

 

One big note on these questions is, that I looked verry closly at the vanilla codes for firework. (something wich come closely to what I want to add) I use the same setup (and GL functions) except that I changed a lot of the calculations and values and that I made my own texture for it (with multiple colours, so thats why I want to dupe the code rather than use it).

 

I hope I made my point(s)/questions pretty clear, if not (or you need more information) feel free to ask.

 

Thanks for your time!

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

3: The client position is at the player's feet from what I've seen, I added 1.6 to the y position to account for this when I spawned particles, personally.

4: Sounds like you haven't specified this.noClip = false in your EntityFX derived class's constructor, or particlevar.noclip = false after making the instance.

Posted

Thanks for your reply!

 

about point 4, I actualy did set "this.noClip" to false. so what else could it be?

 

about point 3, either I miss your point, or I didn't describe it clearly enough.

in point 3 I tried to describe that even if I set the movement to 0, that there is still movement wich is linked to the player's movement.

the second thing I tried to explain is, that particles do have an offset when they are spawned in (not at the player, but at a block). its on offset of 0.01 or lower I think. but still pretty annoying if you want it to be in an exact location you tell him to spawn at.

The first thing is possible to fix (if I look at the vanilla particles), the second one, I'm not sure.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

Hm yeah I thought you were talking about the server/client positioning mismatch.  Might be an precision error with floats/doubles if it's that small?  I kind of doubt it though, otherwise I'm not sure what's causing the offset.  As for the first part of 3, it sounds like you somehow got the particles' motionX/Y/Z entangled with the player's position, that's odd.  Posting code will probably be necessary for further troubleshooting. (always best to post code anyway, there's only so much we can do without it)

 

 

As for 4, you could try making a new AABB, setting it up with the particle's positioning and whatever dimensions you want, and returning it in setBoundingBox().  What class are you extending that has setBoundingBox() though?

Posted

yea, its propably better to post the codes. right now everything works except the FlashFX. it doesn't show somehow. I spawn these particles with above an TileEntity. so it shouldn't have any motion nor offset.

 

EffectWelling, this is the Entity I spawn in with "EffectRenderer.addEffect()". this will spawn in the other 3.

package mechanical_crafting_table.client.particles;

import mechanical_crafting_table.client.particles.entityfx.EntityWellFlashFX;
import mechanical_crafting_table.client.particles.entityfx.EntityWellGlowFX;
import mechanical_crafting_table.client.particles.entityfx.EntityWellSparkFX;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class EffectWelling extends EntityFX
{

private boolean canSpawn = true;
private int WellAge;
private int count;

public EffectWelling(World world, double x,	double y, double z, double mX,double mY, double mZ)
{
	super(world, x, y, z, 0.0D, 0.0D, 0.0D);
	this.motionX = mX;
        this.motionY = mY;
        this.motionZ = mZ;
        this.particleMaxAge = 1;
}

    public void renderParticle(Tessellator tess, float x, float y, float z, float mX, float mY, float mZ) {}
    
    public void onUpdate()
    {
    	if(this.particleAge < this.particleMaxAge && count == 0)
    	{
    		this.createBurst();
    		count++;
    	}
    	++this.WellAge;

        if (this.WellAge > this.particleMaxAge)
        {
            this.setDead();
            count = 0;
        }
    }
    
    private void createBurst()
    {
    	 double d0 = this.rand.nextGaussian() * 0.05D;
         double d1 = this.rand.nextGaussian() * 0.05D;

         this.createParticle(this.posX + 0.095D, this.posY - 0.095D, this.posZ, 0.0D, 0.0D, 0.0D, 3);
         
         for (int i = 0; i < 2; ++i)
         {
             double d2 = this.rand.nextGaussian() * 0.15D + d0;
             double d3 = this.rand.nextGaussian() * 0.15D + d1;
             double d4 = this.rand.nextDouble() * 0.5D;
             this.createParticle(this.posX, this.posY, this.posZ, d2, d4, d3, 1);
         }
         
         this.createParticle(this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, 2);
    }
    
    private void createParticle(double x, double y, double z, double mX, double mY, double mZ, int id)
    {
    	switch(id){
    	case 1:
	EntityWellSparkFX WellingSpark = new EntityWellSparkFX(this.worldObj, x, y, z, mX, mY, mZ);
	Minecraft.getMinecraft().effectRenderer.addEffect(WellingSpark);
    	        break;

    	case 2:
    		EntityWellGlowFX WellingGlow = new EntityWellGlowFX(this.worldObj, x, y, z);
    		WellingGlow.setRBGColorF((float)244/255, (float)255/255, (float)130/255);
    		WellingGlow.setFadeColour((float)160/255, (float)33/255, (float)46/255);
    		Minecraft.getMinecraft().effectRenderer.addEffect(WellingGlow);
    	        break;

    	case 3:
    		EntityWellFlashFX WellingFlash = new EntityWellFlashFX(this.worldObj, x, y, z);
    		Minecraft.getMinecraft().effectRenderer.addEffect(WellingFlash);
                break;
    	}	
    }
}

 

EntityWellingSparkFX.

package mechanical_crafting_table.client.particles.entityfx;

import static org.lwjgl.opengl.GL11.*;
import mechanical_crafting_table.Main;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class EntityWellSparkFX extends EntityFX
{
private static final ResourceLocation WellingFXTexture = new ResourceLocation(Main.MODID, "textures/particles/WellingSpark.png");

public EntityWellSparkFX(World world, double x, double y, double z, double mX, double mY, double mZ)
{
	super(world, x, y, z, mX, mY, mZ);
	this.motionX = mX;
	this.motionY = mY;
	this.motionZ = mZ;
	this.particleScale *= 0.4F;
	this.particleAlpha = 1.0F;
	this.particleMaxAge = 5 + this.rand.nextInt(5);
	this.particleGravity = 1F;
	this.noClip = false;
}

 public void renderParticle(Tessellator tess, float particleTicks, float x, float y, float z, float u, float v)
 {
	if(this.particleAge < this.particleMaxAge)
	{
		Minecraft.getMinecraft().renderEngine.bindTexture(WellingFXTexture);
		glDepthMask(false);
		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

		glAlphaFunc(GL_GREATER, 0.003921569F);
		tess.startDrawingQuads();
		tess.setBrightness(getBrightnessForRender(particleTicks));
		glAlphaFunc(GL_GREATER, 0.6F - ((float)this.particleAge + particleTicks - 1.0F) * 0.25F * 0.5F);
		float f10 = 0.1F * this.particleScale;
		float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)particleTicks - interpPosX);
        float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)particleTicks - interpPosY);
        float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)particleTicks - interpPosZ);
        
        tess.addVertexWithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);//WithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);// (double)f7, (double)f9);
        tess.addVertexWithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 0, 1);//WithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 1, 0);// (double)f7, (double)f8);
        tess.addVertexWithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);//WithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);// (double)f6, (double)f8);
        tess.addVertexWithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 1, 0);//WithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 0, 1);// (double)f6, (double)f9);
        tess.draw();
        
		glDisable(GL_BLEND);
		glDepthMask(true);
		glAlphaFunc(GL_GREATER, 0.1F);
	}
}

public void onUpdate()
{
	this.prevPosX = this.posX;
	this.prevPosY = this.posY;
	this.prevPosZ = this.posZ;

	if (this.particleAge++ >= this.particleMaxAge)
	{
		this.setDead();
	}

	if (this.particleAge > this.particleMaxAge / 2)
	{
		this.setAlphaF(1.0F - ((float) this.particleAge - (float) (this.particleMaxAge / 2)) / (float) this.particleMaxAge);
	}

	this.motionY -= 0.004D * (double)this.particleGravity;;
	this.moveEntity(this.motionX, this.motionY, this.motionZ);
	this.motionX *= 0.2D;//0.9100000262260437D;
	this.motionY *= 0.05D;//0.9100000262260437D;
	this.motionZ *= 0.2D;//0.9100000262260437D;
	this.setRBGColorF(this.particleRed, this.particleBlue, this.particleGreen);

	if (this.onGround) {
		this.motionX *= 0.699999988079071D;
		this.motionZ *= 0.699999988079071D;
	}

	if (this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0)
	{
		EntityWellSparkFX EntityWell = new EntityWellSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
		EntityWell.particleAge = EntityWell.particleMaxAge / 2;
		Minecraft.getMinecraft().effectRenderer.addEffect(EntityWell);
	}
}

public int getBrightnessForRender(float brightnessFR)
{
	return 15728880;
}

public float getBrightness(float brightness)
{
	return 1.0F;
}

    public boolean canBePushed()
    {
        return true;
    }
    
    public int getFXLayer()
    {
        return 3;
    }
}

 

EntityWellingGlowFX.

package mechanical_crafting_table.client.particles.entityfx;

import static org.lwjgl.opengl.GL11.*;
import mechanical_crafting_table.Main;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class EntityWellGlowFX extends EntityFX
{
private static final ResourceLocation GlowingFXTexture = new ResourceLocation(Main.MODID, "textures/particles/WellingGlow.png");
private float fadeColourR;
private float fadeColourG;
private float fadeColourB;
private boolean hasFade;

public EntityWellGlowFX(World world, double x, double y, double z)
{
	super(world, x, y, z, 0, 0, 0);
	this.particleScale *= 0.75F;
	this.particleMaxAge = 72;// + this.rand.nextInt(12);
	this.noClip = false;
	this.particleGravity = 0F;
	this.particleAlpha = 1.0F;
	this.motionX = this.motionX * 0.00;
	this.motionY = this.motionY * 0.00;
	this.motionZ = this.motionZ * 0.00;
}

public void renderParticle(Tessellator tess, float particleTicks, float x, float y, float z, float u, float v)
{
	if (this.particleAge < this.particleMaxAge)
	{
		Minecraft.getMinecraft().renderEngine.bindTexture(GlowingFXTexture);
		glDepthMask(false);
		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		tess.startDrawingQuads();

		tess.setBrightness(getBrightnessForRender(particleTicks));
		float f10 = 0.1F * this.particleScale;
		float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)particleTicks - interpPosX);
        float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)particleTicks - interpPosY);
        float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)particleTicks - interpPosZ);
        
		float CR = this.particleRed;
		float CG = this.particleGreen;
		float CB = this.particleBlue;
        
        tess.setColorRGBA_F(CR, CG, CB, this.particleAlpha);
		tess.addVertexWithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);//WithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);// (double)f7, (double)f9);
        tess.addVertexWithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 0, 1);//WithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 1, 0);// (double)f7, (double)f8);
        tess.addVertexWithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);//WithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);// (double)f6, (double)f8);
        tess.addVertexWithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 1, 0);//WithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 0, 1);// (double)f6, (double)f9);
        tess.draw();

		glDisable(GL_BLEND);
		glDepthMask(true);
		glAlphaFunc(GL_GREATER, 0.1F);
	}
}

public void setFadeColour(float CR, float CG, float CB)
{
	this.fadeColourR = CR;
	this.fadeColourG = CG;
	this.fadeColourB = CB;
	this.hasFade = true;
}

public void onUpdate()
{
	this.prevPosX = this.posX;
	this.prevPosY = this.posY;
	this.prevPosZ = this.posZ;

	if (this.particleAge++ > this.particleMaxAge)
	{
		this.setDead();
	}

	if(this.particleAge > (this.particleMaxAge / 4)*3)
	{
		this.setAlphaF(this.particleAlpha / 2);
	}
	else
	{
		this.setAlphaF(1.0F);
	}

	if (this.hasFade && this.particleAge > this.particleMaxAge / 2)
	{
		this.particleRed -= ((this.particleRed - this.fadeColourR) / this.particleMaxAge) * this.particleAge;
		this.particleGreen -= ((this.particleGreen - this.fadeColourG) / this.particleMaxAge) * this.particleAge;
		this.particleBlue -= ((this.particleBlue - this.fadeColourB) / this.particleMaxAge) * this.particleAge;
	}

	this.moveEntity(this.motionX, this.motionY, this.motionZ);
	this.motionX *= 0.0;
	this.motionY *= 0.0;
	this.motionZ *= 0.0;
}

public int getBrightnessForRender(float brightnessFR)
{
	return 15728880;
}

public float getBrightness(float brightness)
{
	return 0.654F;
}

public int getFXLayer()
{
	return 3;
}
}

 

EntityWellingFlashFX. Right now this is not visible, eventhough it gets spawned in.(I debugged it)

package mechanical_crafting_table.client.particles.entityfx;

import static org.lwjgl.opengl.GL11.*;
import mechanical_crafting_table.Main;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class EntityWellFlashFX extends EntityFX
{
private static final ResourceLocation WellingFXTexture = new ResourceLocation(Main.MODID, "textures/particles/WellingFlash.png");

public EntityWellFlashFX(World world, double x, double y, double z)
{
	super(world, x, y, z);
	this.particleScale = 8.0F;
	this.particleMaxAge = 2;
	this.particleGravity = 1F;
	this.particleAlpha = 0.4F;
	this.noClip = false;
}

@Override
 public void renderParticle(Tessellator tess, float particleTicks, float x, float y, float z, float u, float v)
 {
	if(this.particleAge < this.particleMaxAge)
	{
		Minecraft.getMinecraft().renderEngine.bindTexture(WellingFXTexture);
		glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		glDepthMask(false);
		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		glAlphaFunc(GL_GREATER, 0.003921569F);

		tess.startDrawingQuads();
		tess.setBrightness(this.getBrightnessForRender(particleTicks));
		float f10 = 0.1F * this.particleScale;
		float f11 = (float) this.posX;
        float f12 = (float) this.posY;
        float f13 = (float) this.posZ;
        
        tess.addVertexWithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);
        tess.addVertexWithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 0, 1);
        tess.addVertexWithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);
        tess.addVertexWithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 1, 0);
        tess.draw();
        
		glDisable(GL_BLEND);
		glDepthMask(true);
		glAlphaFunc(GL_GREATER, 1.0F);
	}
}

public void onUpdate()
{
	this.prevPosX = this.posX;
	this.prevPosY = this.posY;
	this.prevPosZ = this.posZ;

	if (this.particleAge++ >= this.particleMaxAge)
	{
		this.setDead();
	}

	if (this.particleAge > this.particleMaxAge / 5)
	{
		this.setAlphaF(this.particleAlpha / 2);
	}

	this.moveEntity(this.motionX, this.motionY, this.motionZ);
	this.motionX *= 0.0D;
	this.motionY *= 0.0D;
	this.motionZ *= 0.0D;
}

public int getBrightnessForRender(float brightnessFR)
{
	return 15728880;
}

public float getBrightness(float brightness)
{
	return 1.0F;
}
    
    public int getFXLayer()
    {
        return 3;
    }
}

 

About point 4, I tried to set the boundingbox earlier, but doesnt seem to work somehow. Anyway, I looked at the XPOrb, cause they get picked up when they collide with the player. And it seems that MC. is using an actual Entity. so I might have to create one for this purpose.(but it will get pretty laggy if I spawn a bunch of them in. (wich Im planning on doing)

 

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

Well, I went in and tinkered with the flash FX, the reason it's not showing up is because of the addVertexWithUV calls, I don't care to go through the math too much but I suspect it's because all the verticies are being created in the exact same coordinates since you set f11-13 to the posX/Y/Z instead of the calculations the vanilla code uses:

 

float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * particleTicks - interpPosX);
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * particleTicks - interpPosY);
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * particleTicks - interpPosZ);

 

Replacing them with the vanilla calculations makes it show up fine.

Posted

Yes, copy-pasting the codes brought it back. but there is one thing I'm concerned about. The part

"(this.posX - this.prevPosX)" (and same for Y and Z) should return 0 since there is no motion.

But when I leave that part out, the particle is gone!

 

So it might explain the texture offset(maybe?), but right now I'm clueless of where the motion is comming from (or at least the difference between 'this' and 'prev' position).

The only thing I can think of right now is that the paritcles (because they are all rendered in FXLayer 3) might share some values? just like the colour and Aplha?

 

this is realy confusing.  :-\

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

This is why I was saying I don't care to go through the math, I don't know what interpPosX is, but it's likely not the same as posX/prevPosX.  It works, no point in arguing about it. :P

Posted

The alpha, you're not using the same alpha or blend func combinations as me, so try:

 

GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);

 

You're also specifying GL11.glColor4F's alpha as 1.0, that may also be it.  You also don't disable GL11.GL_LIGHTING for the particle render, but I doubt that would cause this.

 

As for the particle moving with the player, do you think setting canBePushed to true is causing it to collide with the player and move with them?  Otherwise, I'm not sure about that.

Posted

Hey, I swapped the codes out and it works kinda better?

I can change the alpha to a verry low number, while it just wouldn't show up when I did that with my code. But sadly, no matter what value I set the alpha to, it doesn't seem to affect the texture verry much.

so am I doing something wrong here?

 

secondly, the particle movement problem is unfortunatly still not solved.

 

btw, sorry that I wasn't answering. I had to do some stuff this weekend.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

Well, is your texture grayscale?  AFAIK, particle textures have to be an oldschool alpha map, black being transparent and white being completely opaque, and then you color them in the code.  I may be wrong about that, though, someone else can comment on that.  I also haven't figured out how to make black particles yet, which is either me not understanding fully how the particle textures and GL code work together, or having to find a needle-in-a-haystack combination of blendfuncs and alphafuncs to invert the color its looking for to subtract as alpha and leave a full black particle.  For some reason the opacity and color are inextricably linked, too?  When I try to color my particles a darker shade of a color, it just decreases the opacity.  I need to learn OGL and rewrite the vanilla code, it seems really...bad. :/

Posted

Wel I figured out that when you set your brightness at 0. Your particles will be pitch black!

And my particles are not greyscaled. I made them with paint.net, just a basic editor. If you look at the colour tab, there are 7 different scales. I only use 4 (3 colours and alpha) but what you want to do is set one of the other 3 scales? Im pretty sure you'll be able to do that with gl11..

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted
  On 4/7/2015 at 7:03 PM, Izzy Axel said:

Well, is your texture grayscale?  AFAIK, particle textures have to be an oldschool alpha map, black being transparent and white being completely opaque, and then you color them in the code.  I may be wrong about that, though, someone else can comment on that.  I also haven't figured out how to make black particles yet

 

Multiply their grayscale texture by the color black?  0 times anything is 0.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Are yo using an EntityFX layer below 3? Cause they have an renderer already wich might cause this Problem.

 

Anyway, does anybody knows where the particle movements come from?(the movments wich are linked with the players movement)

 

And Does anybody know where the undifined offset is comming from?

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

lol, didn't see your link, anyway try to ad this:

public int getBrightnessForRender(float brightnessFR)
{
	return 0; //or another low number
}

I'm sure your particle will be black  :P, Ik it's not clean but it works!

 

Anyway, we are getting a bit off topic here.

There are still 2 problems I realy don't know how to solve. Is there anyone who have an idea?

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hey all, I'm wondering if there's a way to forceload a chunk instantly in 1.18.2.  I'm updating an older mod from 1.16, and in that version of the game I was able to do so just by calling serverWorld.forceChunk(chunkPos.x, chunkPos.z, false); which would then enable me to access the Chunk at that location and get a list of the entities inside it (which is my end goal here as well).  However, although in 1.18 I still have the ability to call serverLevel.setChunkForced(chunkPos.x, chunkPos.z, false); it no longer seems to load the chunk immediately, but instead (from my understanding) submits a ticket to load it on the next tick.  This is problematic for my use case, as my goal is to load the chunk, access an entity within it, and then deload the chunk on completion, which I can no longer do in a single tick with this method.  LevelChunks also don't seem to contain a list of entities anymore in 1.18, and seem to have less automated functions connected to them, which could I suppose also be the source of my issue. Is there a way to load a chunk instantaneously from its coordinates and immediately access the entities within it?
    • I figured it out, you just use Minecraft.getInstance().player.displayClientMessage(Component.literal("Message"),false); or how sendSystemMessage() does it in 1.20.6 with Minecraft.getInstance().gui.getChat().addMessage(Component.literal("Message")); Suddenly clicked that I can look into classes to see how they work
    • Hi, im trying to install the last version of forge but everytime i have some issues. The last one was "the librairies failed to download try again." Here you can see the log. Thanks for all !
    • I've had this problem for a long time.  I tried uninstalling and reinstalling drivers, I've tried running different mods, nothing is working so far and I wanted to try reaching out finally [11:49:29] [main/INFO]:Found mod file YungsBetterWitchHuts-1.19.4-Forge-2.3.0.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/WARN]:Mod file C:\Users\bleed\curseforge\minecraft\Install\libraries\net\minecraftforge\fmlcore\1.19.4-45.3.0\fmlcore-1.19.4-45.3.0.jar is missing mods.toml file [11:49:29] [main/WARN]:Mod file C:\Users\bleed\curseforge\minecraft\Install\libraries\net\minecraftforge\javafmllanguage\1.19.4-45.3.0\javafmllanguage-1.19.4-45.3.0.jar is missing mods.toml file [11:49:29] [main/WARN]:Mod file C:\Users\bleed\curseforge\minecraft\Install\libraries\net\minecraftforge\lowcodelanguage\1.19.4-45.3.0\lowcodelanguage-1.19.4-45.3.0.jar is missing mods.toml file [11:49:29] [main/WARN]:Mod file C:\Users\bleed\curseforge\minecraft\Install\libraries\net\minecraftforge\mclanguage\1.19.4-45.3.0\mclanguage-1.19.4-45.3.0.jar is missing mods.toml file [11:49:29] [main/WARN]:Attempted to select a dependency jar for JarJar which was passed in as source: playeranimator. Using Mod File: C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods\player-animation-lib-forge-1.0.2+1.19.4.jar [11:49:31] [main/ERROR]:Mixin config necronomicon.forge.mixins.json does not specify "minVersion" property [11:49:31] [main/WARN]:Reference map '${refmap_target}refmap.json' for corgilib.forge.mixins.json could not be read. If this is a development environment you can ignore this message [11:49:34] [main/WARN]:Mixin apply failed animation_overhaul.mixins.json:AbstractClientPlayerEntityMixin -> net.minecraft.client.player.AbstractClientPlayer: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Invalid descriptor on animation_overhaul.mixins.json:AbstractClientPlayerEntityMixin->@Inject::animation_overhaul$init(Lnet/minecraft/client/multiplayer/ClientLevel;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/world/entity/player/ProfilePublicKey;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V! Expected (Lnet/minecraft/client/multiplayer/ClientLevel;Lcom/mojang/authlib/GameProfile;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V but found (Lnet/minecraft/client/multiplayer/ClientLevel;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/world/entity/player/ProfilePublicKey;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V [ -> Inject -> animation_overhaul.mixins.json:AbstractClientPlayerEntityMixin->@Inject::animation_overhaul$init(Lnet/minecraft/client/multiplayer/ClientLevel;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/world/entity/player/ProfilePublicKey;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V] at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] at vazkii.patchouli.client.handler.BookCrashHandler.appendToCrashReport(BookCrashHandler.java:23) ~[Patchouli-1.19.4-79.1-FORGE.jar%23236!/:1.19.4-79.1-FORGE] at net.minecraft.SystemReport.handler$zkc000$patchouli_addContext(SystemReport.java:516) ~[client-1.19.4-20230314.122934-srg.jar%23250!/:?] at net.minecraft.SystemReport.<init>(SystemReport.java:58) ~[client-1.19.4-20230314.122934-srg.jar%23250!/:?] at net.minecraft.CrashReport.<init>(CrashReport.java:31) ~[client-1.19.4-20230314.122934-srg.jar%23250!/:?] at net.minecraft.CrashReport.m_127529_(CrashReport.java:216) ~[client-1.19.4-20230314.122934-srg.jar%23250!/:?] at net.minecraft.client.main.Main.main(Main.java:137) ~[forge-45.3.0.jar:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.4-45.3.0.jar:?] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?] at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] [11:49:38] [Render thread/WARN]:Assets URL 'union:/C:/Users/bleed/curseforge/minecraft/Install/libraries/net/minecraft/client/1.19.4-20230314.122934/client-1.19.4-20230314.122934-srg.jar%23250!/assets/.mcassetsroot' uses unexpected schema [11:49:38] [Render thread/WARN]:Assets URL 'union:/C:/Users/bleed/curseforge/minecraft/Install/libraries/net/minecraft/client/1.19.4-20230314.122934/client-1.19.4-20230314.122934-srg.jar%23250!/data/.mcassetsroot' uses unexpected schema
    • The error in the console Starting Gradle Daemon... Gradle Daemon started in 2 s 964 ms FAILURE: Build failed with an exception. * Where: Build file 'C:\Data\forge-1.20.1-47.3.22-mdk\build.gradle' line: 5 * What went wrong: Could not apply requested plugin [id: 'net.minecraftforge.gradle', version: '[6.0,6.2)'] as it does not provide a plugin with id 'net.minecraftforge.gradle'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s). > Plugin with id 'net.minecraftforge.gradle' not found. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 6s The 'error line is "id 'net.minecraftforge.gradle' version '[6.0,6.2)'" which is the code that came with the mdk. I can also give the build.gradle file if you think that'll help. How do I get the plugin to work again? I didnt even touch it. It seems to have broken on its own. Any help is appreciated! Thanks!  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.