User Tools

Site Tools


rendering

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rendering [2019/03/06 16:18]
grondag [Named Materials]
rendering [2019/03/20 19:37] (current)
grondag [Material Properties]
Line 77: Line 77:
  
 ==== Named Materials ==== ==== Named Materials ====
-Materials can be registered with a name-spaced identifier using ''​Renderer.registerMaterial()''​ and retrieved using ''​Renderer.materialById()''​. ​ This can be useful if you publish a mod that allows third-party extensions and you want to give those extensions a supported way to use consistent materials. ​ In that case, your mod will need to register ​your materials with identifiers that are visible to extensions. ​+Materials can be registered with a name-spaced identifier using ''​Renderer.registerMaterial()''​ and retrieved using ''​Renderer.materialById()''​. ​ This can be useful if you publish a mod that allows third-party extensions and you want to give those extensions a supported way to use consistent materials. ​ In that case, your mod should ​register materials with identifiers that are visible to extensions. ​
  
 Named materials can also be used by ''​Renderer''​ implementations to expose custom materials that provide special effects not possible with the standard materials. Renderers that provide custom materials are responsible for declaring and exposing the identifiers used to retrieve them. Named materials can also be used by ''​Renderer''​ implementations to expose custom materials that provide special effects not possible with the standard materials. Renderers that provide custom materials are responsible for declaring and exposing the identifiers used to retrieve them.
Line 86: Line 86:
 When selecting a material, you can choose from materials with the following attributes: When selecting a material, you can choose from materials with the following attributes:
  
 +=== Blend Mode ===
 +  * Allows the effect of multiple render layers in the same block/​model.
 +  * Set via ''​MaterialFinder.blendMode()''​
 +  * Accepts ''​BlockRenderLayer''​ enum values.
 +  * Does NOT necessarily mean the material actually renders in the given pass - only that it will appear to do so. (Some renderers may combine passes or do other optimizations. ​ Don't write MixIns that are tied to ''​BlockRenderLayer''​ passes.)
 +  * If null (the default) then terrain renders will use the value of ''​Block.getRenderLayer()''​. Other render contexts will use ''​BlockRenderLayer.TRANSLUCENT''​ as the default.
  
 +=== Diffuse Shading On/Off ===
 +  * Controls color modification for diffuse lighting.
 +  * On by default.
 +  * Disable via ''​MaterialFinder.disableDiffuse()''​.
 +  * In vanilla Minecraft this causes sides and bottoms of blocks to be darker, creating visual distinction.
 +  * Renderer implementations may use a different diffuse lighting model but should still honor this setting.
  
 +
 +=== Ambient Occlusion Shading On/Off ===
 +  * Controls color modification for ambient occlusion lighting.
 +  * On by default.
 +  * Disable via ''​MaterialFinder.disableAo()''​.
 +  * In vanilla Minecraft this causes interior corners to be darker, creating visual distinction.
 +  * Renderer implementations may use a different AO lighting model but should still honor this setting.
 +
 +=== Emissive Rendering On/Off ===
 +  * When enabled, causes quad to be rendered at full brightness.
 +  * Disabled by default.
 +  * Enable via ''​MaterialFinder.emissive()''​
 +  * Does not require a custom per-vertex light map and it is recommended you don't provide one.
 +  * Diffuse and Ambient Occlusion shading //will// apply unless also disabled.
 +
 +=== Sprite Depth ===
 +  * Default value is 1 and 1 is the only value currently supported in the API.
 +  * Values > 1 are reserved for future use and for use by extensions.
 +  * Extensions can use this to accept multiple sprites on the same quad to create overlay effects.
 +
 +
 +=== Color Index On/Off ===
 +  * Controls application of block color index to vertex colors.
 +  * If block color index != -1 it will be applied by default. (Set using ''​MutableQuadView.colorIndex()''​).
 +  * Use ''​MaterialFinder.disableColorIndex()''​ to prevent color application.
 +  * Generally only useful when an extension is active the supports a material sprite depth > 1, In that case it allows block color to apply only to specific sprite layers.  ​
 ===== Meshes ===== ===== Meshes =====
  
rendering.1551889135.txt.gz ยท Last modified: 2019/03/06 16:18 by grondag