Minecraftforge: ForgeLightPipeline and OptiFine

Created on 14 Jul 2016  路  15Comments  路  Source: MinecraftForge/MinecraftForge

I am working on making OptiFine compatible with the ForgeLightPipeline and currently there are several problems which can not be solved:

A. BlockColors.colorMultiplier() is only used for quads with tint index
OptiFine allows resource packs to define a color palette for any block and texture and it needs a way to enable color multiplier for any quad independent of the tint index.

Possible solution:
VertexLighterFlat should call "BlockColors.colorMultiplier()" for all quads independent of the tintIndex.
Update "BlockColors.colorMultiplier()" to return -1 for tintIndex < 0.

B. The VertexBuffer needs to know the current sprite which is being rendered
This is required for the AA/AF render mode.

Possible solution:
Add a dummy method "VertexBuffer.setSprite()".
ForgeBlockModelRenderer should call it before rendering the current quad.

C. It is not possible to replace the rendered quads without replacing the whole model
It would be much easier to replace single quads or quad lists instead of the whole model.

Possible solution:
Add method "BlockModelRenderer.getRenderQuads(quads, worldIn, stateIn, posIn, buffer, enumfacing, rand)" with dummy implementation returning the quad list without change.
The method should be called from ForgeBlockModelRenderer.render() once per quad list.

Stale

Most helpful comment

Well, Mojang hired a rendering guy, and the rendering stuff in MC has only been stagnant because they got rid of their old rendering guy.
So.. ya, logic would assume 1.14 would have all the better rendering stuff!

And yes, I will correct you, you're not compleetly wrong but you're more wrong then most people in the MC community things. One of the MAJOR points of moving to the model system was to move the rendering OFF the CPU. By baking the models and letting the game upload them directly in bulk. TileEntities have special renderer {TESRs} which modders abuse the crap out of which is a large contributor to the performance issue. Anyways, as anyone who gives the MC update process 1/2 a try can tell. Minecraft as a codebase is getting better. It has growing pains yes. But that's what Forge is for. Just keep waiting and working on making things better.

All 15 comments

I really hope Lex or Fry looks at this because this would help a lot with rendering and compatibility, especially because i use the same vertex-format 'hacks' in my mod as AE2 does. Much luck with this and thanks for the attempt sp614x o/

@mezz Any news on this?

B has been resolved by adding setTexture to IVertexConsumer a while back

This issue has been automatically marked as stale because it has not had activity in a long time, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

The issue is still relevant.

I know it was bumped in December already, but I feel it is still relevant - Are there any news on this?

Not being able to have custom lightmap values with Optifine sure is a pain, especially because Java Minecraft still runs like a piece of hot garbage even on high-end systems without it.

Fry has been hired by Mojang so unfortunately there is no progress or timeline on this issue.
In the meantime, the Forge lighting pipeline can be disabled with a config option if really necessary. It's a tradeoff for sure but hopefully useful to someone.

@bs2609 would you be interested in this issue?

I have been open about the fact that I am not a rendering guy. And with the fact that our last rendering guy got stolen by Mojang ;) If you're wanting complex rendering changes you're going to have to put the work in yourself. Ideally, 1.14~ is going to remove the 'Forge Pipeline' as it'll be done properly in Vanilla. So ya, if you want Optifine hooked in you're gunna have to work on the PRs yourself.

As for Java running 'like a piece of hot garbage'... 600 FPS, 12% CPU in my system running Forge... Yes its not the best when you toss a crapload of mods in but thats not Forge/Vanilla's fault.

I'm happy to see Fry being on the Mojang team now, actually - high hopes that he's gonna improve the rendering of Minecraft, don't get me wrong there :)

As for 1.14~ removing the Forge Pipeline and it being done properly in Vanilla, are you referring to Mojang doing some changes there?
In that case you seem to have more insider information than the public does, hehe ;)

In regards to the "bad performance" part - I get that mods drain the performance, don't worry.
Though, it's not entirely the fault of modders - last information I had was that Minecraft still does parts of the rendering on the CPU, though feel free to correct me there if I'm wrong since I am indeed curious about it.
Also, the fact that Minecraft is coming from a pure single-threaded environment from back in the day and there still being remnants of that in the code is also a slight warning of "how to not code a game well"; Granted, both Mojang and (from what I know) Forge have done fixes to that already, but it's not entirely how it should be.

Well, Mojang hired a rendering guy, and the rendering stuff in MC has only been stagnant because they got rid of their old rendering guy.
So.. ya, logic would assume 1.14 would have all the better rendering stuff!

And yes, I will correct you, you're not compleetly wrong but you're more wrong then most people in the MC community things. One of the MAJOR points of moving to the model system was to move the rendering OFF the CPU. By baking the models and letting the game upload them directly in bulk. TileEntities have special renderer {TESRs} which modders abuse the crap out of which is a large contributor to the performance issue. Anyways, as anyone who gives the MC update process 1/2 a try can tell. Minecraft as a codebase is getting better. It has growing pains yes. But that's what Forge is for. Just keep waiting and working on making things better.

Thank you for explaining this so well.
I've been out of the loop on Minecraft, especially when it comes to modding, for the past 3-6 months so I've missed out on some stuff for sure there :)

Anyway, I don't want to derail this issue too much into smalltalk ;)

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.

The issue is still relevant and would have to be fixed.

Hi, this issue should be fixed. Please :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaedalusGame picture DaedalusGame  路  3Comments

darthvader45 picture darthvader45  路  3Comments

juliand665 picture juliand665  路  3Comments

MJRLegends picture MJRLegends  路  3Comments

williewillus picture williewillus  路  3Comments