Jump to content

[1.7.10]Particle render problems


N247S

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

I guese, anyway Thanks for the tip!

 

Continuing on, do you have an idea on how to fix the other prolems?

The two major problems are the alpha wich isn't working as it should and the movement linked with the players movement.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. :/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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