sp614x / optifine

1.8k stars 418 forks source link

Translucent emissive overlays don't seem to work on blocks #1021

Open JackDotJS opened 6 years ago

JackDotJS commented 6 years ago

I just started to play around with this new feature. Basically what I'm trying to achieve is partially emissive textures. This is working perfectly fine for items, but not for blocks. However, the overlay still works as it should on the dropped block item.

emissive1

sp614x commented 6 years ago

The overlay textures use the same translucency mode as the main texture. Non-translucent main texture -> non-translucent overlay. Translucent main texture -> translucent overlay.

JackDotJS commented 6 years ago

Is there a way for you to give translucency only to the overlay? If it's possible, I'd like to suggest adding that in the next/future update.

sp614x commented 6 years ago

If the main texture is used as a base for the emissive overlay then translucency would not be needed. For example: start with the base texture, remove all non-emissive pixels, save as emissive.

1LotS commented 6 years ago

The problem is that if there is no translucency in emissive textures, you can't make smooth transitions to the normal texture, thus you have a hard border because of the big difference between the textures' light levels, which looks terrible

sp614x commented 6 years ago

Should the overlay layer be configurable per texture or general for all overlays?

1LotS commented 6 years ago

I think, it is easier to add translucency in general, because artist can make non-transculent textures themselves. There's no need for the game to do that.

sp614x commented 6 years ago

Translucent block overlays are slower and they need special handling in order to render in the correct order. This could be added to "emissive.properties"

force.translucent=<true|false>
JackDotJS commented 6 years ago

Would force.translucent enable translucency in every block overlay? If it's really that slow, maybe there should be another option to specify block IDs to enable translucency on.

MisterQuiggly commented 6 years ago

Progress report on this?

sp614x commented 6 years ago

You could use Custom Blocks to make redstone ore render as translucent. The overlay would then automatically be rendered as translucent. https://github.com/sp614x/optifine/blob/master/OptiFineDoc/doc/block.properties#L12

genandnic commented 5 years ago

You could use Custom Blocks to make redstone ore render as translucent. The overlay would then automatically be rendered as translucent. https://github.com/sp614x/optifine/blob/master/OptiFineDoc/doc/block.properties#L12

Still very confused on this. My block.properties contains the line "layer.translucent=redstone_ore" and though the emissive texture uses alpha, it doesn't work. The overlay always renders at full opacity. I've also tried "layer.translucent=redstone_ore_e" (the emissive layer) but still no luck.

sp614x commented 5 years ago

Have you checked the game output if it complains about the block properties?

genandnic commented 5 years ago

The only messages I see about the block.properties files are: [09:49:51] [Client thread/INFO] [Config]: [OptiFine] CustomBlockLayers: Loading optifine/block.properties [09:49:51] [Client thread/INFO] [Config]: [OptiFine] CustomBlockLayers: optifine/block.properties

Here's the emissive texture (a square of with an alpha of 75): redstone_ore_e Here's what I see in-game no matter what alpha the block set to: 2019-01-29_09 55 56