Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

Did you try before ?

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

 

See EntityFX#setParticleIcon(Icon) just in case.

 

  • Author

@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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.