Jump to content

Recommended Posts

Posted (edited)

Hey there,

I have a problem with a particle. Here is an image: https://imgur.com/a/pf2F9mh

As you can clearely there are issues when the particles are overlapping. Also it does not render when a translucent pixel is in front of it. I am using a custom particle Renderer (Yes, I have tried the vanilla translucen one).

Here is the renderer:

	      public void beginRender(BufferBuilder buf, TextureManager texmanager) {
	  			RenderSystem.enableBlend();
	  			RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
	  			RenderSystem.alphaFunc(GL11.GL_GEQUAL, 0.003921569F);
	  			RenderSystem.disableLighting();

	  			texmanager.bindTexture(AtlasTexture.LOCATION_PARTICLES_TEXTURE);
	  			buf.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
	      } //there is also some resetting stuff in finishRender()

I have tried disabling the depthMask but then there is a different issue: The clouds are rendered in front of the particle (I can provide an image if necessary).

 

Does anyone have an idea on how to fix this?

 

Edited by xX_deadbush_Xx
Posted (edited)

Yeah, I had this problem too in PneumaticCraft, but (with much thanks to Botania, which does it right with the mana pool particles), I got it figured out:

 

You will need a custom particle render type, like this: https://github.com/TeamPneumatic/pnc-repressurized/blob/1.15/src/main/java/me/desht/pneumaticcraft/client/particle/AirParticle.java#L91

 

And return that from your getParticleType() method: https://github.com/TeamPneumatic/pnc-repressurized/blob/1.15/src/main/java/me/desht/pneumaticcraft/client/particle/AirParticle.java#L71

 

The important thing is the alternative GL blend function (GL11.GL_SRC_ALPHA, GL11.GL_ONE), and GL_GREATER rather GL_EQUAL in the alpha func.

 

Update: just realised you're already using GL_ONE in a custom render type.  Have you also provided the finishRender() method in your render type?

Edited by desht

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.