Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8] (SOLVED) make particle render from further away


sigurd4
 Share

Recommended Posts

currently, other than spawning them, i havent really been messing around with particles yet. how would i go about making my particle render from further away from the player? is that possible? there are two alternatives i can think of at the moment (i dont know much about this)

1: make a new particle extending the one i use, but set to be rendered from further away (i have no idea how to do that, though, and if there is an easier way i'd prefer that),

2: use something i've only heard about, called tesselator (or something like that), which allows me to do rendering-related stuff.

 

is there another way? which is simplest? and how would i go about doing that?

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Link to comment
Share on other sites

What particles are you talking about?

 

If you are spawning  them using World.spawnParticle():

    @SideOnly(Side.CLIENT)
    public void spawnParticle(EnumParticleTypes particleType, boolean p_175682_2_, double p_175682_3_, double p_175682_5_, double p_175682_7_, double p_175682_9_, double p_175682_11_, double p_175682_13_, int ... p_175682_15_)
    {
        this.spawnParticle(particleType.getParticleID(), particleType.func_179344_e() | p_175682_2_, p_175682_3_, p_175682_5_, p_175682_7_, p_175682_9_, p_175682_11_, p_175682_13_, p_175682_15_);
    }

The second parameter is a boolean, if you set it to true, it should spawn the effect regardless of how far away the player is.

 

(From RenderGlobal.spawnEntityFX(): 
    private EntityFX spawnEntityFX(int p_174974_1_, boolean p_174974_2_, double p_174974_3_, double p_174974_5_, double p_174974_7_, double p_174974_9_, double p_174974_11_, double p_174974_13_, int ... p_174974_15_)
    {
//....

            if (p_174974_2_)  {  // if force render
                return this.mc.effectRenderer.spawnEffectParticle(p_174974_1_, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_);
            }  else  { // check distance d6 = delta X, d7  = delta y, d8 = delta z -> if distance is more than 16 (sq distance > 16*16 = 256), don't render
                double d9 = 16.0D;
                return d6 * d6 + d7 * d7 + d8 * d8 > 256.0D ? null : (k > 1 ? null : this.mc.effectRenderer.spawnEffectParticle(p_174974_1_, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_));
            }

 

-TGG

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

 Share



×
×
  • Create New...

Important Information

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