Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projectile earth spells break perspective #1387

Open
d-baranowski opened this issue Jan 27, 2016 · 10 comments
Open

Projectile earth spells break perspective #1387

d-baranowski opened this issue Jan 27, 2016 · 10 comments

Comments

@d-baranowski
Copy link

Hi, great mod ;)

I found a bug.
When you shoot a projectile earth spell while looking at water or nether portal block the spell particle (Ball which indicates the projectile), the water will display as if it's closer to player than the spell particle, resulting in a weird visual bug.

Also, (not sure if bug or feature :P) If you have 100% affinity earth levitation spell wont work.

Some screen shots:
2016-01-27_22 03 43
2016-01-27_22 03 44
2016-01-27_22 03 51
2016-01-27_22 03 51_2

I'm playing on Minecraft 1.7.10.
Here is a list of mods I'm using:
AM2-1.4.0.009
AnimationAPI-1.7.10-1.2.4
Aroma1997Core-1.7.10-1.0.2.13
AromaBackup-1.7.10-0.0.0.5
Baubles-1.7.10-1.0.1.10
BiblioCraft[v1.11.3][MC1.7.10]
Botania r1.7-207
ChickenChunks-Mod-1.7.10
CodeChickenCore-1.7.10-1.0.6.43-universal
CustomMainMenu-MC1.7.10-1.5
denseores-1.6.2
DynamicLights-1.7.10
EnchantingPlus-1.7.10-3.0.2-d
FastLeafDecay-1.7.10-1.0
ForgeMultipart-1.7.10-1.1.2.332-universal
HQM-The Journey (4.2.4)
INpureCore-[1.7.10]1.0.0B9-62
InventoryTweaks-1.59-dev-152
Jabba-1.2.1a_1.7.10
LittleBlocks-2.2.4.4
MCA-1.7.10-5.1.1.1-universal
Morpheus-1.7.10-1.6.4
MusicChoices-1.2_for_1.7.10
neiaddons-1.12.10.33-mc1.7.10
NEIIntegration-MC1.7.10-1.0.11
NotEnoughItems-1.7.10-1.0.4.107-universal
NotEnoughResources-1.7.10-0.1.0.101
OptiFine_1.7.10_HD_U_C1
RadixCore-1.7.10-2.1.1-universal
ResourceLoader-1.2
roguelike-1.7.10-1.4.4
SlimevoidLibrary-2.0.4.7
ttCore-MC1.7.10-0.1.1-78
Waila-1.5.10_1.7.10
WailaHarvestability-mc1.7.x-1.1.2
Wawla-1.3.1-1.7.10

@d-baranowski d-baranowski changed the title Projectile earth spells breake perspective Projectile earth spells break perspective Jan 27, 2016
@TheIcyOne
Copy link
Contributor

Does this still occur without OptiFine installed?

@d-baranowski
Copy link
Author

Just checked. Yes it does

@jjtParadox
Copy link
Contributor

This is actually a limitation of the Minecraft engine itself. All particles render behind water, portals, and other certain blocks (Try breaking a block on top of a lake to see this yourself). This could possibly be "fixed" by rendering projectiles in an entirely different manor, but that would require a complete rewrite of the rendering and animation code.

@d-baranowski
Copy link
Author

Yes, you're right. This only happens to projectile particles, but not to particles generated when casting a spell with shape self. Perhaps that can be used for projectiles as well ? Furthermore for frost spells the actual projectile is rendered behind water, however the particles that follow the projectile (snow flakes) are rendered correctly.
2016-01-28_19 17 48
2016-01-28_19 30 01

@jjtParadox
Copy link
Contributor

That's... not what I expected. @Mithion do you have any clue why this is?

@Mithion
Copy link
Owner

Mithion commented Jan 29, 2016

They all use the same renderer code, so I highly doubt it's specific to the earth one alone

It has to do with Minecraft's water/portals rendering based on depth buffering. If I'm seeing this correctly, it should happen to any block that is semitransparent (I would also test with ice to see if it can be replicated there - it would narrow down the issue further).

Most other pfx/projectiles don't show it was well due to the fact that they have transparency inherent to the sprite. The earth one does not, so it's much more apparent. However, since some of them do have transparency, the code is necessary for them to render correctly. This however causes weirdness with water and other semitransparent blocks.

For reference, the renderer:

https://github.com/Mithion/ArsMagica2/blob/master/src/main/java/am2/entities/renderers/RenderSpellProjectile.java

@jjtParadox
Copy link
Contributor

Just tested with ice and colored glass, and that "weirdness" did indeed happen.

With the trail effects, are those rendered properly because they don't have transparency?

@Mithion
Copy link
Owner

Mithion commented Jan 29, 2016

Trails are done by the particle renderer and not the projectile renderer. Particle rendering happens at a different time during the render cycle, and that could mean the GL flags/state is different than the projectile.

I took a quick look and don't see anything in the particle render code that would cause this to be different, but, IIRC the method:

@Override public int getFXLayer(){ return 2; }

causes them to render properly over other transparent blocks.

@jjtParadox
Copy link
Contributor

Hm, getFXLayer() is from EntityFX, which is a little different from the Render class used for the actual ball'o'spell. Any good way to apply EntityFX to the SpellProjectile?

@Mithion
Copy link
Owner

Mithion commented Jan 30, 2016

Yes, though not necessarily easily. You need to recreate the GL state that exists when rendering FXLayer 2. What that entails, I'm not sure. You'd need to look at the way particles are rendered and go from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants