Commit Graph

203 Commits

Author SHA1 Message Date
simibubi
8f1fd1c94e Merge remote-tracking branch 'origin/flw/next' into mc1.17/dev 2021-11-01 19:49:50 +01:00
PepperBell
fd1990f732 Dyed toolbox fixes
- Add in-world toolbox dyeing
- Fix toolbox dyeing recipe not keeping stack NBT
- Fix toolbox handle rendering on solid layer
- Fix shadows for items on belts
- Clean up other in-world dyeing and dyed block code
2021-10-30 12:43:34 -07:00
PepperBell
9870431db8 Miscellaneous refactors
- Refactor custom rendered items; The renderer now creates the model
instead of the other way around
- Only tick wrench cog rotation and linked controller renderer if client
is not paused
- Move all model swapping code from CreateClient to ModelSwapper
- Register client resource reload listener before initial resource
reload
- Use TextureStitchEvent.Post event instead of resource reload listener
for filling sprites of SpriteShiftEntries
- Reuse Random instance in PartialItemModelRenderer
- Make all config fields final
- Merge package foundation.renderState into foundation.render
- Move BreakProgressHook from package foundation to foundation.block
- Rename ResourceReloadHandler to ClientResourceReloadListener
- Rename ProperDirectionalBlock to WrenchableDirectionalBlock
2021-10-16 01:46:49 -07:00
PepperBell
d72f343fdf Various cleanup
- Remove Create namespace restriction in CTSpriteShifter
- Add method to register ponder chapter lang
- Clean up palette block code; Closes #386
- Clean up tag code
- Use Create.asResource in as many places as possible
- Organize imports
2021-10-02 13:02:27 -07:00
Jozufozu
069506ae09 Initial data/struct format refactor
- Inspired by jellysquid3's vertex sinks
 - More robust/extensible solution for data writes
2021-09-12 14:49:01 -07:00
Jozufozu
322902d056 Some decoupling
- New Loader class in charge of loading and compiling everything
 - ShaderSources now only loads sources
 - ShaderSources is immutable now
 - Resolver singleton in charge of managing name resolutions
 - ProgramSpecs go through Resolver
 - WorldShaderPipeline no longer needs reference to ShaderSources
2021-08-10 15:20:52 -07:00
Jozufozu
208c6eff89 A heck of a lot
- Reorganize everything
 - Isolate SourceFile related things
 - Should consider decoupling ShaderLoader from resource loading
 - Document a lot of newer things
 - Index functions
 - Awkward WorldContext builder
 - Template responsible for providing shader inputs
 - Template is now an abstract class
 - Template provides GLSL version
 - ProgramSpecs now only accept one file
2021-08-10 02:06:23 -07:00
Jozufozu
cb47ca8452 Reload
- Redo shader loading
 - Now loads an immutable SourceFile containing some metadata
 - Replace legacy compilation pipeline with improved new one using new api
 - Builtins are defined in one file, now "header"
 - New ErrorReporter/ErrorBuilder methods
 - Fancier shader loading errors
2021-08-08 22:35:27 -07:00
zelophed
ca02ac038f Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/dev
# Conflicts:
#	src/main/java/com/simibubi/create/foundation/ponder/SceneBuilder.java
2021-08-07 01:23:43 +02:00
PepperBell
99be93e8a6 Synchronization
- Make PonderRegistry use a ThreadLocal current namespace
- Add synchronized blocks to some methods that modify maps or lists
- Move some non-thread safe method calls to the event.enqueueWork
lambdas
2021-07-31 17:28:41 -07:00
zelophed
0fe3230640 color me surprised
- move functionality of ColorHelper into a new Color class
- replace usage of java.awt.Color with our own color in most cases
2021-07-31 14:21:19 +02:00
Jozufozu
17421df5ce Contraptions have l a y e r s
- SBB contraption rendering is done through Flywheel's RenderLayerEvent
 - Fix instanced tile rendering on contraptions and in ponder worlds
 - Bump flywheel version
 - Some package-info.javas
2021-07-28 14:25:50 -07:00
Jozufozu
cb8e6d92d5 Contraptions use flywheel for vanilla tiles
- Update more usage of glActiveTexture to the enum wrapper
 - Fix superglue rendering in the solid layer
 - Fix issue caused by states with different textures on contraptions
 - Bump flywheel version
2021-07-26 16:27:18 -07:00
simibubi
b6b6b32e96 SuperBustedBuffer
- Removed obsolete milk filling/draining code and recipes
- Fixed lack of transforms on cpu rendered stuff
- Move fluid remapper to RemapHelper
2021-07-24 22:32:27 +02:00
Jozufozu
a52b6d766f MaterialGroups and massive refactors
- Move material stuff to its own package
 - The various render functions in the material tree now bind to specific render layers
 - Instancers can choose which layer to use
 - The layers are SOLID, CUTOUT, and TRANSPARENT
 - More layers are likely unnecessary, but we'll see
 - Deprecate functions in MaterialManager in favor of more builderesque ones using MaterialGroups
 - Catching up with Flywheel
 - Remove MatrixStacker in favor of Flywheel's TransformStack (thread safety too)
2021-07-21 20:30:35 -07:00
a048285699 Bulk remap, compiles 2021-07-15 11:32:03 +02:00
PepperBell
e3386c178a Minor SBB clean up
- Allow custom light from dual (utility) light method to be applied
- Reorganize and rename some members
2021-07-10 22:39:42 -07:00
simibubi
2821fd7135 Lamptank
- Fixed custom rendered models rendering full bright when supposed to render full dark
2021-07-11 01:14:38 +02:00
Jozufozu
f1da8b8f1e Cull code to fix crash on mac
- A bunch of dead code removal
2021-07-10 15:20:34 -07:00
PepperBell
b5c0684dd6 Rendering refactors
- Fix fluid rendering in JEI scenes
- Add more separate options to SuperByteBuffer
- Fix copper backtank diffuse when worn
- Fix enchantment glint on custom rendered items; Closes #1846
2021-07-03 01:03:37 -07:00
PepperBell
4bf61e049d Organize imports 2021-06-27 11:03:21 -07:00
JozsefA
3ce4e2c5e8 Cleanup flywheel event listeners, fix crash on server startup 2021-06-23 13:19:03 -07:00
JozsefA
d189efd987 Whoops missed some classes 2021-06-23 00:16:24 -07:00
JozsefA
aeff644cc3 Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/chromatic-projector
# Conflicts:
#	src/generated/resources/assets/create/lang/en_us.json
#	src/generated/resources/assets/create/lang/unfinished/de_de.json
#	src/generated/resources/assets/create/lang/unfinished/es_es.json
#	src/generated/resources/assets/create/lang/unfinished/es_mx.json
#	src/generated/resources/assets/create/lang/unfinished/fr_fr.json
#	src/generated/resources/assets/create/lang/unfinished/it_it.json
#	src/generated/resources/assets/create/lang/unfinished/ja_jp.json
#	src/generated/resources/assets/create/lang/unfinished/ko_kr.json
#	src/generated/resources/assets/create/lang/unfinished/nl_nl.json
#	src/generated/resources/assets/create/lang/unfinished/pl_pl.json
#	src/generated/resources/assets/create/lang/unfinished/pt_br.json
#	src/generated/resources/assets/create/lang/unfinished/ru_ru.json
#	src/generated/resources/assets/create/lang/unfinished/zh_cn.json
#	src/generated/resources/assets/create/lang/unfinished/zh_tw.json
#	src/main/java/com/simibubi/create/AllContainerTypes.java
#	src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java
#	src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java
#	src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerTileEntity.java
#	src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java
#	src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java
#	src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintRenderer.java
#	src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java
#	src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java
#	src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java
#	src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java
#	src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java
#	src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java
#	src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java
#	src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java
#	src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java
#	src/main/java/com/simibubi/create/foundation/ponder/content/ChainDriveScenes.java
#	src/main/java/com/simibubi/create/foundation/render/SuperByteBuffer.java
#	src/main/resources/META-INF/mods.toml
#	src/main/resources/assets/create/lang/default/messages.json
#	src/main/resources/assets/create/lang/default/tooltips.json
2021-06-19 16:11:18 -07:00
JozsefA
652111c233 Yeet 2021-06-19 00:29:18 -07:00
simibubi
158c0eba15 Blending in with Entities
- Changed blueprint entity and item rendering to be more Optifine friendly (?)
- Punching blueprints now clears the slot before breaking it
- Fix a dist issue with KTEs
- Added recipe for blueprint
2021-06-16 21:39:38 +02:00
JozsefA
d612cfdd34 Merge remote-tracking branch 'origin/mc1.16/dev' into chromatic-projector 2021-06-11 10:31:18 -07:00
PepperCode1
3c84087f15 Fix saw and PSI diffuse
- Fix saw and portable storage/fluid interface diffuse lighting
- Remove "disableDiffuseTransform" option from SuperByteBuffer
- Switch argument order in RenderedContraption constructor to be consistent with superclass (ContraptionWorldHolder)
2021-06-07 16:14:51 -07:00
JozsefA
d47f898c76 Move away from a static backend class, add a registration event 2021-06-06 15:46:16 -07:00
reidbhuntley
c97da3868f Prevent AgriCraft/InfinityLib crash 2021-06-05 16:14:16 -04:00
JozsefA
457fff78f3 Mostly untangle the loading functions, enforce triangles 2021-06-04 17:55:05 -07:00
JozsefA
9bac709dfd Event system, sort of untangle backend 2021-06-04 15:56:46 -07:00
JozsefA
2300ef2088 Organization, renaming, and fixing a dumb crash 2021-05-30 17:05:41 -07:00
JozsefA
7f9ff3b7ca Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/chromatic-projector 2021-05-25 12:23:55 -07:00
JozsefA
db53b7a3cf Fix gl error spam 2021-05-23 19:36:44 -07:00
PepperBell
6c390977d8 Init Cleanup
- Refactor AllContainerTypes to use Registrate
- Replace RegistryEntry in AllEntityTypes and AllFluids with EntityEntry and FluidEntry, respectively
- Make AllEntityTypes use Registrate to register entity renderers instead of a separate method
- Refactor AllColorHandlers
- Fix error when a POI block is moved by a contraption
- Rename some static final fields to be upper snake case
- Make static fields in Create and CreateClient final
- Add I prefix to Coordinate interface
- Fix typo (BracketedTileEntityBehaviour#isBacketPresent)
- Make mixins go in alphabetical order
- Make pack.mcmeta use 2 spaces for indents
2021-05-22 18:00:10 -07:00
JozsefA
9352ef9ede Json program specs, new extension/gamestate system.
- Program specs are now loaded from json instead of being defined in code and registered manually.
 - Within the json spec, a program can define a list of states.
 - A state consists of:
   - A "when" clause.
   - A list of strings to be #defined.
   - A list of extensions to apply at program link time.
 - Each frame, the first state whose "when" clause returns true will be used.
 - A when clause consists of:
  - A state provider defined by a resource location.
  - A value to match.
 - When the value returned by the provider matches the value defined in the when clause, the when clause is considered to be 'true'.
 - There is syntactic sugar for when a provider returns a boolean value.
 - This system is in its infancy, and there is plenty of room for improvement.
2021-05-22 17:45:01 -07:00
JozsefA
9a178ef9d8 Abstract fog
- WorldPrograms no longer accept an explicit fog mode.
 - They now inherit from a class that takes a list of arbitrary shader extensions
2021-05-19 19:11:06 -07:00
JozsefA
4d755dc506 More simplification
- Move more stuff to the flywheel namespace
 - Give up on ShaderConstants, there's a better way to do it
 - A semblance of better crash reports
2021-05-19 16:35:37 -07:00
JozsefA
c48b94f0fb Merge remote-tracking branch 'origin/chromatic-projector' into mc1.16/chromatic-projector
# Conflicts:
#	src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java
2021-05-18 14:07:34 -07:00
JozsefA
55703d8838 Move to the template system and overhaul instance attributes
- All material shaders now use the template system.
 - Because of the template system, we can know what attributes a material has, along with how they're formatted.
 - All of the *Attribute enums are effectively inlined, as the context they used to provide is no longer needed.
2021-05-18 14:05:52 -07:00
JozsefA
695fe98d28 MaterialSpecs choose their model formats 2021-05-16 20:37:26 -07:00
PepperBell
fd6c930a65 Merge remote-tracking branch 'upstream/chromatic-projector' into
contraption-lighting

# Conflicts:
#	src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java
#	src/main/java/com/simibubi/create/foundation/render/SuperByteBuffer.java
2021-05-16 19:12:14 -07:00
PepperBell
61b101f0c6 Refactor contraption matrices
- Create ContraptionMatrices class for better management of matrices during the contraption rendering process
- Fix diffuse lighting when rendering contraptions without Flywheel
- Clean up TileEntityRenderHelper
- Add disableDiffuseTransform to SuperByteBuffer and fix light calculation logic
2021-05-16 18:42:56 -07:00
JozsefA
6227e81066 TemplateBuffer is no more
- Instead, BufferBuilderReader can decode parts of a BufferBuilder.
 - BufferedModel and its subclasses are now created directly with a ByteBuffer.
 - ContraptionModel renamed to IndexedModel.
 - InstancedModel and IndexedModel both now take model formats as arguments.
 - All of this allows for better abstraction, composition, and control of models rendered with Flywheel.
2021-05-16 15:39:52 -07:00
JozsefA
9ff193946c Refactor InstancedModel to not rely on inheritance
- Instead, MaterialSpecs store the information
 - RenderMaterials are now generic on InstanceData instead of InstancedModel
 - RenderMaterials are directly constructed with and store a MaterialSpec
2021-05-15 16:41:56 -07:00
PepperBell
f33b08d996 Minor fixes
- Fix holder refresh
- Fix SuperByteBuffer light calculation
- Remove unused import
2021-05-15 12:15:06 -07:00
PepperBell
67052fd00c Add lighting to non-Flywheel contraptions
- Pass contraption world to movement behavior rendering
- Add hybrid lighting option to SuperByteBuffer (takes max of world light and vertex light)
- Create ContraptionWorldHolder for caching contraption worlds for contraptions that are not rendered with Flywheel
- Refactor some parts of contraption rendering
2021-05-15 00:21:20 -07:00
JozsefA
79977aee14 Choose between 2 different implementations of a mapped buffer
- MappedBufferRange (GL30) and MappedFullBuffer (GL15) so far
 - Persistent mapping (optionally?) would be nice
2021-05-14 22:51:14 -07:00
JozsefA
a9cdb1ab6b Begin buffer rework 2021-05-14 18:04:25 -07:00