Jump to content

Possible to render 16x16 particles?


Whale Cancer

Recommended Posts

Been playing around with particle effects for a few hours now and I've been trying to understand how getTextureManager.bindTexture works when setting the texture of the particle. Here is bindTexture:

 

    public void bindTexture(ResourceLocation par1ResourceLocation)
    {
        Object object = (TextureObject)this.mapTextureObjects.get(par1ResourceLocation);

        if (object == null)
        {
            object = new SimpleTexture(par1ResourceLocation);
            this.loadTexture(par1ResourceLocation, (TextureObject)object);
        }

        TextureUtil.bindTexture(((TextureObject)object).getGlTextureId());
    }

 

I can't really see where in that code it would limit the texture to 8x8, so I must be looking in the wrong place?

 

I believe this is the only relevant section of my mod for the actual setting of the texture of the particle (other than the actual spawning of the particle stuff, which all works):

 

    @Override
    @SideOnly(Side.CLIENT)
    	public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7){
    	tessellator.draw();
    	Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("doormod:textures/particle/custom_particles.png"));
    	tessellator.startDrawingQuads();
    	tessellator.setBrightness(200);
    	super.renderParticle(tessellator, par2, par3, par4, par5, par6, par7);
    	tessellator.draw();
    	Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/particle/custom_particles.png"));
    	tessellator.startDrawingQuads();
    }

 

If I am not mistaken, par2 through par7 are just the origin and motion of the particle and tessellator only has to do with rendering the particle and nothing to do with setting the texture.

 

So... any help or direction? Thanks in advance!

Link to comment
Share on other sites

@diesieben07

 

I assumed you meant super.renderParticle so I looked through that and found the logic that limited it to 8x8 textures. I tried making a custom tesselator class and changing that logic, but I ended up running into an error through making a non-static refrence to a static method (IIRC).

 

Did you try before ?

With the changes in resource packs, that old limitation might have gone.

 

See EntityFX#setParticleIcon(Icon) just in case.

 

I messed around with setParticleIcon and it seems to return 8x8 as well. It is currently used in vanilla to grab an 8x8 texture from the texture of a side of a block for the purpose of creating those little damage particles when you hit something.

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.

Announcements



×
×
  • Create New...

Important Information

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