Jump to content

[1.7.10][SOLVED] Black Particles


Izzy Axel

Recommended Posts

I've been butting heads with this issue for a while now, I'm trying to either color a white particle black, which glColor doesn't work for, due to lower numbers decreasing opacity for an unknown reason, or inverting the additive blending, knocking out white and leaving black, but the blendfunc that should do that, GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA, results in a black square with a hole knocked out in the middle, no matter if I give it the inverted alpha map or the normal one.  The tessellator's brightness also controls opacity for an unknown reason, so that's out too.

 

 

Particle Renderer

 

 

Edit: So, with this stuff I changed in the renderer, spawning black particles by themselves works, but spawning the rest of the colors makes either the black particles have the knockout effect I described above while none of the other colors have it, or every other color particles have the knockout effect and the black doesn't. Here's the EntityFX too in case I'm doing something here that's wrong/bad

 

 

EntityFX

Link to comment
Share on other sites

Ok, what is it that you are trying to do?  Are you trying to make "particles which are black"?

 

In which case, you probably want the blend mode GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ZERO);

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

I dont know how to do it with glstuff etc. But a cheaty way to make particles black is setting the particle brightness at 0. Of course if you want to make it from white to black over time it might hit some wierd colours (like brown). But if you stick at either gxLayer 3 of 0, you should be fine.

 

Note if you use fxLayer 0, it will bind your texture to all particles of fxLayer0. This means as long as your paricle is rendered, the vanilla particles will display thier default and your texture.

 

I havent got the time to dig into this problem yet, so I honestly dont know how to encounter this.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

@draco Either coloring a white particle black or inverting the knockout GL performs with additive blending so it knocks out white instead of black, so I'm left with a black image instead of a white one.  ZERO ZERO results in the black particles being solid black squares instead of knocking out the white properly, while the normal particles are colored squares with a hole knocked out in the middle, still.

Link to comment
Share on other sites

Try it as N247S said, then.  Setting the brightness to 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

Tess#setBrightness shouldnt do anything with alpha. It will only aply an colour filter. but if you have aplied alpha in your base texture, it might become transparant.

 

But to be clear, you have an black and white texture, and you want to make white become black over time? Or do you want it to become transparant?

 

Anyway, could you post some of your render codes with what you've already tried? Cause there might be some extra gl stuff that needs calling(e.g. gl_Enable(blendFunction) for example) also, I want to take a look at some other settings such as fxLayer and colour settings.

 

Strange though that the setBrightness didnt work out.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

EntityFX

Renderer

 

 

Standard/white/colored particles alpha map:

lightCharge.png

 

 

Black particles alpha map: (I want to knock the white out instead of the black, but doing this seems to "infect" the standard alpha maps (that are being rendered at the same time) with the blendfunc used to accomplish this inverted additive blending)

lightChargeBlack.png

 

 

It keeps switching between these as the particles spawn:

Hole Puncher - Episode 1

Hole Puncher - Episode 2

 

 

Edit: ...wait I know what's happening, it's the local variable for whether the particle is black or not.  I'll have to make a separate particle for the black ones.

 

I always get so focused on a problem that the simplest things elude me. :/

Link to comment
Share on other sites

Nice to hear that its solved :D. (and a nice model too).

 

I got one question out of interest though, how are the particle movements when your player is moving?

Since I experiance a slight offset wich is linked to the players movement on FXLayer 3.

though in your case, that shouldnt be a problem I think.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

No offset, never has been even with stationary particles.  There is one more weird caveat with this setup, but its with the model, all models actually, when you look up and the model gets to a certain point off the bottom of the screen, it just vanishes altogether. :/  Same thing that happens to the End Portal, I doubt there's an easy way to fix it.

Link to comment
Share on other sites

No offset or movement when you move the player? Strange, than I need to test some things soon :D. How big is your texture?

 

About the object rendering, its indeed posible that your model 'vanish', this happens if the tileEntity isn't in the screen anymore. In the picture you showed particles above an tileEntity, now I don't know if you spawn them in with the tileEntity class, but if you did, the particles will disapear as well when you dont look at the tileEntity.

 

Is it bad? I dont think so, since its vanilla behavior. But if you don't want it, you need to somehowe render it outside the vanilla base renderer, or modify the rendere. Both are rather complicated and an question for troubles. So I would leave it be.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

 

32x32

 

 

In that case I should probably make it render from the dummy tile entity so it doesn't disappear until it gets offscreen entirely.

 

I'm using Forge's AdvancedModelLoader to load an OBJ; I haven't looked into it yet so I don't know if it's rendering it with vanilla methods or what.  I do the particles inside the the TileEntity class, yes, but they don't disappear with the TE when you look up too far.

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.