Merge branch '6.0' into crater
# Conflicts: # core/assets/icons/icons.properties # core/assets/sprites/block_colors.png # core/assets/sprites/sprites.atlas # core/assets/sprites/sprites.png # core/assets/sprites/sprites3.png # core/assets/sprites/sprites5.png # core/src/mindustry/content/Blocks.java # core/src/mindustry/ui/fragments/PlayerListFragment.java # core/src/mindustry/world/BlockStorage.java
BIN
core/assets-raw/sprites/blocks/distribution/cross.png
Normal file
|
After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 513 B |
BIN
core/assets-raw/sprites/blocks/distribution/mass-conveyor.png
Normal file
|
After Width: | Height: | Size: 412 B |
BIN
core/assets-raw/sprites/blocks/environment/cliff.png
Normal file
|
After Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 291 B |
BIN
core/assets-raw/sprites/blocks/environment/slag.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 291 B |
|
Before Width: | Height: | Size: 520 B |
|
Before Width: | Height: | Size: 870 B |
|
Before Width: | Height: | Size: 991 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
BIN
core/assets-raw/sprites/blocks/mechs/alpha-mech-pad.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 579 B After Width: | Height: | Size: 579 B |
BIN
core/assets-raw/sprites/blocks/units/ground-factory-top.png
Normal file
|
After Width: | Height: | Size: 663 B |
BIN
core/assets-raw/sprites/blocks/units/ground-factory.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 261 B |
|
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 201 B |
BIN
core/assets-raw/sprites/effects/particle.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 266 B |
|
Before Width: | Height: | Size: 265 B |
|
Before Width: | Height: | Size: 266 B |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 213 B |
|
Before Width: | Height: | Size: 179 B |
|
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 213 B |
|
Before Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 440 B |
8
core/assets-raw/sprites/rubble/pack.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
duplicatePadding: true,
|
||||
combineSubdirectories: true,
|
||||
flattenPaths: true,
|
||||
maxWidth: 2048,
|
||||
maxHeight: 2048,
|
||||
fast: true
|
||||
}
|
||||
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 320 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
|
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 870 B |
|
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 991 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
core/assets-raw/sprites/units/alpha-base.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
core/assets-raw/sprites/units/alpha-leg.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
core/assets-raw/sprites/units/alpha.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
core/assets-raw/sprites/units/dart.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
|
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 657 B |
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 181 B |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 509 B |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 448 B |
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
BIN
core/assets-raw/sprites/units/vanguard.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 6.8 KiB |
BIN
core/assets-raw/sprites/weapons/vanguard-blaster-equip.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@@ -105,11 +105,13 @@ mods = Mods
|
||||
mods.none = [LIGHT_GRAY]No mods found!
|
||||
mods.guide = Modding Guide
|
||||
mods.report = Report Bug
|
||||
mods.openfolder = Open Mod Folder
|
||||
mods.openfolder = Open Folder
|
||||
mods.reload = Reload
|
||||
mod.display = [gray]Mod:[orange] {0}
|
||||
mod.enabled = [lightgray]Enabled
|
||||
mod.disabled = [scarlet]Disabled
|
||||
mod.disable = Disable
|
||||
mod.content = Content:
|
||||
mod.delete.error = Unable to delete mod. File may be in use.
|
||||
mod.requiresversion = [scarlet]Requires min game version: [accent]{0}
|
||||
mod.missingdependencies = [scarlet]Missing dependencies: {0}
|
||||
@@ -121,14 +123,15 @@ mod.enable = Enable
|
||||
mod.requiresrestart = The game will now close to apply the mod changes.
|
||||
mod.reloadrequired = [scarlet]Reload Required
|
||||
mod.import = Import Mod
|
||||
mod.import.github = Import GitHub Mod
|
||||
mod.import.file = Import File
|
||||
mod.import.github = Import From GitHub
|
||||
mod.item.remove = This item is part of the[accent] '{0}'[] mod. To remove it, uninstall that mod.
|
||||
mod.remove.confirm = This mod will be deleted.
|
||||
mod.author = [LIGHT_GRAY]Author:[] {0}
|
||||
mod.missing = This save contains mods that you have recently updated or no longer have installed. Save corruption may occur. Are you sure you want to load it?\n[lightgray]Mods:\n{0}
|
||||
mod.preview.missing = Before publishing this mod in the workshop, you must add an image preview.\nPlace an image named[accent] preview.png[] into the mod's folder and try again.
|
||||
mod.folder.missing = Only mods in folder form can be published on the workshop.\nTo convert any mod into a folder, simply unzip its file into a folder and delete the old zip, then restart your game or reload your mods.
|
||||
mod.scripts.unsupported = Your device does not support mod scripts. Some mods will not function correctly.
|
||||
mod.scripts.disable = Your device does not support mods with scripts. You must disable these mods to play the game.
|
||||
|
||||
about.button = About
|
||||
name = Name:
|
||||
@@ -265,8 +268,6 @@ data.openfolder = Open Data Folder
|
||||
data.exported = Data exported.
|
||||
data.invalid = This isn't valid game data.
|
||||
data.import.confirm = Importing external data will overwrite[scarlet] all[] your current game data.\n[accent]This cannot be undone![]\n\nOnce the data is imported, your game will exit immediately.
|
||||
classic.export = Export Classic Data
|
||||
classic.export.text = [accent]Mindustry[] has just had a major update.\nClassic (v3.5 build 40) save or map data has been detected. Would you like to export these saves to your phone's home folder, for use in the Mindustry Classic app?
|
||||
quit.confirm = Are you sure you want to quit?
|
||||
quit.confirm.tutorial = Are you sure you know what you're doing?\nThe tutorial can be re-taken in[accent] Settings->Game->Re-Take Tutorial.[]
|
||||
loading = [accent]Loading...
|
||||
@@ -367,13 +368,13 @@ editor.importmap = Import Map
|
||||
editor.importmap.description = Import an already existing map
|
||||
editor.importfile = Import File
|
||||
editor.importfile.description = Import an external map file
|
||||
editor.importimage = Import Legacy Map
|
||||
editor.importimage = Import Image File
|
||||
editor.importimage.description = Import an external map image file
|
||||
editor.export = Export...
|
||||
editor.exportfile = Export File
|
||||
editor.exportfile.description = Export a map file
|
||||
editor.exportimage = Export Terrain Image
|
||||
editor.exportimage.description = Export a map image file
|
||||
editor.exportimage.description = Export an image file containing only basic terrain
|
||||
editor.loadimage = Import Terrain
|
||||
editor.saveimage = Export Terrain
|
||||
editor.unsaved = [scarlet]You have unsaved changes![]\nAre you sure you want to exit?
|
||||
@@ -402,6 +403,8 @@ toolmode.drawteams.description = Draw teams instead of blocks.
|
||||
filters.empty = [lightgray]No filters! Add one with the button below.
|
||||
filter.distort = Distort
|
||||
filter.noise = Noise
|
||||
filter.enemyspawn = Enemy Spawn Select
|
||||
filter.corespawn = Core Select
|
||||
filter.median = Median
|
||||
filter.oremedian = Ore Median
|
||||
filter.blend = Blend
|
||||
@@ -421,6 +424,7 @@ filter.option.circle-scale = Circle Scale
|
||||
filter.option.octaves = Octaves
|
||||
filter.option.falloff = Falloff
|
||||
filter.option.angle = Angle
|
||||
filter.option.amount = Amount
|
||||
filter.option.block = Block
|
||||
filter.option.floor = Floor
|
||||
filter.option.flooronto = Target Floor
|
||||
@@ -539,6 +543,7 @@ no = No
|
||||
info.title = Info
|
||||
error.title = [crimson]An error has occured
|
||||
error.crashtitle = An error has occured
|
||||
unit.nobuild = [scarlet]Unit can't build
|
||||
blocks.input = Input
|
||||
blocks.output = Output
|
||||
blocks.booster = Booster
|
||||
@@ -633,6 +638,7 @@ setting.shadows.name = Shadows
|
||||
setting.blockreplace.name = Automatic Block Suggestions
|
||||
setting.linear.name = Linear Filtering
|
||||
setting.hints.name = Hints
|
||||
setting.flow.name = Display Resource Flow Rate[scarlet] (experimental)
|
||||
setting.buildautopause.name = Auto-Pause Building
|
||||
setting.animatedwater.name = Animated Water
|
||||
setting.animatedshields.name = Animated Shields
|
||||
@@ -655,6 +661,7 @@ setting.difficulty.name = Difficulty:
|
||||
setting.screenshake.name = Screen Shake
|
||||
setting.effects.name = Display Effects
|
||||
setting.destroyedblocks.name = Display Destroyed Blocks
|
||||
setting.blockstatus.name = Display Block Status
|
||||
setting.conveyorpathfinding.name = Conveyor Placement Pathfinding
|
||||
setting.coreselect.name = Allow Schematic Cores
|
||||
setting.sensitivity.name = Controller Sensitivity
|
||||
@@ -702,6 +709,7 @@ keybind.press = Press a key...
|
||||
keybind.press.axis = Press an axis or key...
|
||||
keybind.screenshot.name = Map Screenshot
|
||||
keybind.toggle_power_lines.name = Toggle Power Lasers
|
||||
keybind.toggle_block_status.name = Toggle Block Statuses
|
||||
keybind.move_x.name = Move X
|
||||
keybind.move_y.name = Move Y
|
||||
keybind.mouse_move.name = Follow Mouse
|
||||
@@ -860,6 +868,7 @@ liquid.temperature = [lightgray]Temperature: {0}
|
||||
|
||||
block.sand-boulder.name = Sand Boulder
|
||||
block.grass.name = Grass
|
||||
block.slag.name = Slag
|
||||
block.salt.name = Salt
|
||||
block.saltrocks.name = Salt Rocks
|
||||
block.pebbles.name = Pebbles
|
||||
@@ -985,7 +994,8 @@ block.pneumatic-drill.name = Pneumatic Drill
|
||||
block.laser-drill.name = Laser Drill
|
||||
block.water-extractor.name = Water Extractor
|
||||
block.cultivator.name = Cultivator
|
||||
block.dart-mech-pad.name = Alpha Mech Pad
|
||||
block.dart-ship-pad.name = Dart Ship Pad
|
||||
block.alpha-mech-pad.name = Alpha Mech Pad
|
||||
block.delta-mech-pad.name = Delta Mech Pad
|
||||
block.javelin-ship-pad.name = Javelin Ship Pad
|
||||
block.trident-ship-pad.name = Trident Ship Pad
|
||||
@@ -1183,7 +1193,7 @@ block.force-projector.description = Creates a hexagonal force field around itsel
|
||||
block.shock-mine.description = Damages enemies stepping on the mine. Nearly invisible to the enemy.
|
||||
block.conveyor.description = Basic item transport block. Moves items forward and automatically deposits them into blocks. Rotatable.
|
||||
block.titanium-conveyor.description = Advanced item transport block. Moves items faster than standard conveyors.
|
||||
block.plastanium-conveyor.description = The \uf822 moves items in batches.\nOnly accepts items at the back.\nLoads & unloads on all 3 sides.
|
||||
block.plastanium-conveyor.description = The \uf81c moves items in batches.\nOnly accepts items at the back.\nLoads & unloads on all 3 sides.
|
||||
block.junction.description = Acts as a bridge for two crossing conveyor belts. Useful in situations with two different conveyors carrying different materials to different locations.
|
||||
block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building.
|
||||
block.phase-conveyor.description = Advanced item transport block. Uses power to teleport items to a connected phase conveyor over several tiles.
|
||||
@@ -1261,7 +1271,6 @@ block.crawler-factory.description = Produces fast self-destructing swarm units.
|
||||
block.titan-factory.description = Produces advanced, armored ground units.
|
||||
block.fortress-factory.description = Produces heavy artillery ground units.
|
||||
block.repair-point.description = Continuously heals the closest damaged unit in its vicinity.
|
||||
block.dart-mech-pad.description = Provides transformation into a basic attack mech.\nUse by tapping while standing on it.
|
||||
block.delta-mech-pad.description = Provides transformation into a lightly armored hit-and-run attack mech.\nUse by tapping while standing on it.
|
||||
block.tau-mech-pad.description = Provides transformation into an advanced support mech.\nUse by tapping while standing on it.
|
||||
block.omega-mech-pad.description = Provides transformation into a heavily-armored missile mech.\nUse by tapping while standing on it.
|
||||
|
||||
@@ -266,8 +266,6 @@ data.openfolder = Відкрити теку з даними
|
||||
data.exported = Дані вивантажено.
|
||||
data.invalid = Це не дійсні ігрові дані.
|
||||
data.import.confirm = Вивантаження зовнішніх даних перезапише[scarlet] ВСІ[] ваші поточні ігрові дані.\n[accent]Це неможливо скасувати![]\n\nЩойно дані імпортуються, гра негайно закриється.
|
||||
classic.export = Вивантажити класичні дані
|
||||
classic.export.text = [accent]Mindustry[] отримала суттєве оновлення.\nБуло виявлено класичні файли збереження (версія 3.5 збірка 40), або дані мапи. Ви хочете експортувати ці дані в домашню теку телефону, для використання у застосунку Mindustry Classic?
|
||||
quit.confirm = Ви дійсно хочете вийти?
|
||||
quit.confirm.tutorial = Ви впевнені, що знаєте що робите?\nНавчання можна пройти наново[accent] Налаштування->Гра->Пройти навчання ще раз.[]
|
||||
loading = [accent]Завантаження…
|
||||
@@ -368,13 +366,13 @@ editor.importmap = Імпортувати мапу
|
||||
editor.importmap.description = Імпортувати вже наявну мапу
|
||||
editor.importfile = Імпортувати файл
|
||||
editor.importfile.description = Імпортувати зовнішній файл мапи
|
||||
editor.importimage = Імпортувати застаріле зображення
|
||||
editor.importimage = Імпортувати зображення
|
||||
editor.importimage.description = Імпорт із зображенням місцевості
|
||||
editor.export = Експорт…
|
||||
editor.exportfile = Експортувати файл
|
||||
editor.exportfile.description = Експортувати файл мапи
|
||||
editor.exportimage = Експорт зображення місцевості
|
||||
editor.exportimage.description = Експорт файлу з зображенням мапи
|
||||
editor.exportimage.description = Експортувати файл, який містить основний рельєф місцевості.
|
||||
editor.loadimage = Завантажити\nзображення
|
||||
editor.saveimage = Зберегти\nзображення
|
||||
editor.unsaved = [scarlet]У вас є незбережені зміни![]\nВи впевнені, що хочете вийти?
|
||||
@@ -403,6 +401,8 @@ toolmode.drawteams.description = Змінює належність\nблока
|
||||
filters.empty = [lightgray]Немає фільтрів! Додайте хоча б один за допомогою кнопки нижче.
|
||||
filter.distort = Спотворення
|
||||
filter.noise = Шум
|
||||
filter.enemyspawn = Вибір точки появи ворогів
|
||||
filter.corespawn = Вибір ядра
|
||||
filter.median = Медіана
|
||||
filter.oremedian = Рудна медіана
|
||||
filter.blend = Змішування
|
||||
@@ -540,6 +540,7 @@ no = Ні
|
||||
info.title = Інформація
|
||||
error.title = [crimson]Виникла помилка
|
||||
error.crashtitle = Виникла помилка
|
||||
unit.nobuild = [scarlet]Ця одиниця не може будувати
|
||||
blocks.input = Ввід
|
||||
blocks.output = Вивід
|
||||
blocks.booster = Прискорювач
|
||||
@@ -669,7 +670,7 @@ setting.borderlesswindow.name = Вікно без полів[lightgray] (мож
|
||||
setting.fps.name = Показувати FPS і затримку до сервера
|
||||
setting.blockselectkeys.name = Показувати клавіші вибору блока
|
||||
setting.vsync.name = Вертикальна синхронізація
|
||||
setting.pixelate.name = Пікселізація[lightgray] (вимикає анімації)
|
||||
setting.pixelate.name = Пікселізація
|
||||
setting.minimap.name = Показувати мінімапу
|
||||
setting.position.name = Показувати координати гравця
|
||||
setting.musicvol.name = Гучність музики
|
||||
@@ -1261,8 +1262,7 @@ block.crawler-factory.description = Виробляє швидких одиниц
|
||||
block.titan-factory.description = Виробляє поліпшених наземних одиниць.
|
||||
block.fortress-factory.description = Виробляє важкоартилерійних наземних одиниць.
|
||||
block.repair-point.description = Безперервно лікує найближчу пошкоджену бойову одиницю.
|
||||
block.dart-mech-pad.description = Забезпечує перетворення в основний атакуючий мех.\nДля використання натисніть на нього, коли стоїте на ньому.
|
||||
block.delta-mech-pad.description = Забезпечує перетворення в легко броньований атакуючий мех.\nДля використання натисніть на нього, коли стоїте на ньому.
|
||||
block.delta-mech-pad.description = Забезпечує перетворення в легкоброньований атакуючий мех.\nДля використання натисніть на нього, коли стоїте на ньому.
|
||||
block.tau-mech-pad.description = Забезпечує перетворення в поліпшений мех підтримки.\nДля використання натисніть на нього, коли стоїте на ньому.
|
||||
block.omega-mech-pad.description = Забезпечує перетворення в тяжко броньований ракетний мех.\nДля використання натисніть на нього, коли стоїте на ньому.
|
||||
block.javelin-ship-pad.description = Забезпечує перетворення в швидкий, легко броньований перехоплювач.\nДля використання натисніть на нього, коли стоїте на ньому.
|
||||
|
||||
BIN
core/assets/cubemaps/stars/back.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
core/assets/cubemaps/stars/bottom.png
Normal file
|
After Width: | Height: | Size: 447 KiB |
BIN
core/assets/cubemaps/stars/front.png
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
core/assets/cubemaps/stars/left.png
Normal file
|
After Width: | Height: | Size: 316 KiB |
BIN
core/assets/cubemaps/stars/right.png
Normal file
|
After Width: | Height: | Size: 229 KiB |
BIN
core/assets/cubemaps/stars/top.png
Normal file
|
After Width: | Height: | Size: 280 KiB |
@@ -218,5 +218,13 @@
|
||||
63526=oil|liquid-oil-icon
|
||||
63525=cryofluid|liquid-cryofluid-icon
|
||||
63524=underflow-gate|block-underflow-gate-medium
|
||||
63523=plastanium-conveyor|block-plastanium-conveyor-medium
|
||||
63522=crater|crater
|
||||
63523=dart-ship-pad|block-dart-ship-pad-medium
|
||||
63522=alpha-mech-pad|block-alpha-mech-pad-medium
|
||||
63521=cliff|block-cliff-medium
|
||||
63520=legacy-mech-pad|block-legacy-mech-pad-medium
|
||||
63519=ground-factory|block-ground-factory-medium
|
||||
63518=legacy-unit-factory|block-legacy-unit-factory-medium
|
||||
63517=mass-conveyor|block-mass-conveyor-medium
|
||||
63516=crater|crater
|
||||
63515=plastanium-conveyor|block-plastanium-conveyor-medium
|
||||
63514=legacy-command-center|block-legacy-command-center-medium
|
||||
|
||||
BIN
core/assets/music/land.ogg
Normal file
BIN
core/assets/planets/TODO.dat
Normal file
BIN
core/assets/planets/colors.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
123
core/assets/shaders/atmosphere.frag
Normal file
@@ -0,0 +1,123 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
const float PI = 3.14159265359;
|
||||
const float MAX = 10000.0;
|
||||
|
||||
const float PEAK = 0.1;
|
||||
const float FLARE = 0.0025;
|
||||
const float INTENSITY = 14.3;
|
||||
const float G_M = -0.85;
|
||||
|
||||
#define SCATTER_OUT 3
|
||||
#define SCATTER_IN 3
|
||||
|
||||
const int numOutScatter = SCATTER_OUT;
|
||||
const float fNumOutScatter = float(SCATTER_OUT);
|
||||
const int numInScatter = SCATTER_IN;
|
||||
const float fNumInScatter = float(SCATTER_IN);
|
||||
|
||||
varying vec4 v_position;
|
||||
varying mat4 v_model;
|
||||
|
||||
uniform float u_innerRadius;
|
||||
uniform float u_outerRadius;
|
||||
uniform vec3 u_color;
|
||||
uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
uniform vec3 u_campos;
|
||||
uniform vec3 u_rcampos;
|
||||
uniform mat4 u_invproj;
|
||||
uniform vec3 u_light;
|
||||
|
||||
vec2 rayIntersection(vec3 p, vec3 dir, float radius) {
|
||||
float b = dot(p, dir);
|
||||
float c = dot(p, p) - radius * radius;
|
||||
|
||||
float d = b * b - c;
|
||||
if (d < 0.0) {
|
||||
return vec2(MAX, -MAX);
|
||||
}
|
||||
d = sqrt(d);
|
||||
|
||||
float near = -b - d;
|
||||
float far = -b + d;
|
||||
|
||||
return vec2(near, far);
|
||||
}
|
||||
|
||||
float miePhase(float g, float c, float cc) {
|
||||
float gg = g * g;
|
||||
|
||||
float a = (1.0 - gg) * (1.0 + cc);
|
||||
|
||||
float b = 1.0 + gg - 2.0 * g * c;
|
||||
b *= sqrt(b);
|
||||
b *= 2.0 + gg;
|
||||
|
||||
return 1.5 * a / b;
|
||||
}
|
||||
|
||||
float rayleighPhase(float cc) {
|
||||
return 0.75 * (1.0 + cc);
|
||||
}
|
||||
|
||||
float density(vec3 p) {
|
||||
return exp(-(length(p) - u_innerRadius) * (4.0 / (u_outerRadius - u_innerRadius)));
|
||||
}
|
||||
|
||||
float optic(vec3 p, vec3 q) {
|
||||
vec3 step = (q - p) / fNumOutScatter;
|
||||
vec3 v = p + step * 0.5;
|
||||
|
||||
float sum = 0.0;
|
||||
for (int i = 0; i < numOutScatter; i++) {
|
||||
sum += density(v);
|
||||
v += step;
|
||||
}
|
||||
sum *= length(step)*(1.0 / (u_outerRadius - u_innerRadius));
|
||||
return sum;
|
||||
}
|
||||
|
||||
vec3 inScatter(vec3 o, vec3 dir, vec2 e, vec3 l) {
|
||||
float len = (e.y - e.x) / fNumInScatter;
|
||||
vec3 step = dir * len;
|
||||
vec3 p = o + dir * e.x;
|
||||
vec3 v = p + dir * (len * 0.5);
|
||||
|
||||
vec3 sum = vec3(0.0);
|
||||
for(int i = 0; i < numInScatter; i++){
|
||||
vec2 f = rayIntersection(v, l, u_outerRadius);
|
||||
vec3 u = v + l * f.y;
|
||||
float n = (optic(p, v) + optic(v, u))*(PI * 4.0);
|
||||
|
||||
sum += density(v) * exp(-n * (PEAK * u_color + FLARE));
|
||||
v += step;
|
||||
}
|
||||
sum *= len * (1.0 / (u_outerRadius - u_innerRadius));
|
||||
float c = dot(dir, -l);
|
||||
float cc = c * c;
|
||||
return sum * (PEAK * u_color * rayleighPhase(cc) + FLARE * miePhase(G_M, c, cc)) * INTENSITY;
|
||||
}
|
||||
|
||||
vec3 rayDirection(){
|
||||
vec4 ray = v_model*v_position - vec4(u_campos, 1.0);
|
||||
return normalize(vec3(ray));
|
||||
}
|
||||
|
||||
void main(){
|
||||
vec3 dir = rayDirection();
|
||||
vec3 eye = u_rcampos;
|
||||
|
||||
vec3 l = u_light;
|
||||
|
||||
vec2 e = rayIntersection(eye, dir, u_outerRadius);
|
||||
vec2 f = rayIntersection(eye, dir, u_innerRadius);
|
||||
e.y = min(e.y, f.x);
|
||||
|
||||
vec3 result = inScatter(eye, dir, e, l);
|
||||
|
||||
gl_FragColor = vec4(result, 1.0);
|
||||
}
|
||||
13
core/assets/shaders/atmosphere.vert
Normal file
@@ -0,0 +1,13 @@
|
||||
attribute vec4 a_position;
|
||||
|
||||
varying vec4 v_position;
|
||||
varying mat4 v_model;
|
||||
|
||||
uniform mat4 u_model;
|
||||
uniform mat4 u_projection;
|
||||
|
||||
void main(){
|
||||
v_position = a_position;
|
||||
v_model = u_model;
|
||||
gl_Position = u_projection*u_model*a_position;
|
||||
}
|
||||
11
core/assets/shaders/cubemap.frag
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
varying vec3 v_texCoords;
|
||||
|
||||
uniform samplerCube u_cubemap;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = textureCube(u_cubemap, v_texCoords);
|
||||
}
|
||||
12
core/assets/shaders/cubemap.vert
Normal file
@@ -0,0 +1,12 @@
|
||||
attribute vec3 a_position;
|
||||
|
||||
varying vec3 v_texCoords;
|
||||
|
||||
uniform mat4 u_proj;
|
||||
|
||||
const float SCALE = 50.0;
|
||||
|
||||
void main(){
|
||||
v_texCoords = a_position;
|
||||
gl_Position = u_proj * vec4(a_position * SCALE, 1.0);
|
||||
}
|
||||
9
core/assets/shaders/planet.frag
Executable file
@@ -0,0 +1,9 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
varying vec4 v_col;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = v_col;
|
||||
}
|
||||
25
core/assets/shaders/planet.vert
Executable file
@@ -0,0 +1,25 @@
|
||||
attribute vec4 a_position;
|
||||
attribute vec3 a_normal;
|
||||
attribute vec4 a_color;
|
||||
|
||||
uniform mat4 u_proj;
|
||||
uniform mat4 u_trans;
|
||||
uniform vec3 u_lightdir;
|
||||
uniform vec3 u_camdir;
|
||||
uniform vec3 u_ambientColor;
|
||||
|
||||
varying vec4 v_col;
|
||||
|
||||
const vec3 diffuse = vec3(0);
|
||||
const float shinefalloff = 4.0;
|
||||
const float shinelen = 0.2;
|
||||
|
||||
void main(){
|
||||
vec3 norc = u_ambientColor * (diffuse + vec3(clamp((dot(a_normal, u_lightdir) + 1.0) / 2.0, 0.0, 1.0)));
|
||||
float shinedot = max((-dot(u_camdir, a_normal) - (1.0 - shinelen)) / shinelen, 0.0);
|
||||
float shinyness = (1.0 - a_color.a) * pow(shinedot, shinefalloff);
|
||||
vec4 baseCol = vec4(a_color.rgb, 1.0);
|
||||
|
||||
v_col = mix(baseCol * vec4(norc, 1.0), vec4(1.0), shinyness * norc.r);
|
||||
gl_Position = u_proj * u_trans * a_position;
|
||||
}
|
||||
14
core/assets/shaders/planetgrid.frag
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
varying vec4 v_col;
|
||||
varying vec4 v_position;
|
||||
|
||||
uniform vec3 u_mouse;
|
||||
|
||||
const vec4 shadow = vec4(0, 0, 0, 0);
|
||||
|
||||
void main(){
|
||||
gl_FragColor = mix(v_col, shadow, distance(u_mouse, v_position.xyz));
|
||||
}
|
||||
14
core/assets/shaders/planetgrid.vert
Normal file
@@ -0,0 +1,14 @@
|
||||
attribute vec4 a_position;
|
||||
attribute vec4 a_color;
|
||||
|
||||
uniform mat4 u_proj;
|
||||
uniform mat4 u_trans;
|
||||
|
||||
varying vec4 v_col;
|
||||
varying vec4 v_position;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_proj * u_trans * a_position;
|
||||
v_col = a_color;
|
||||
v_position = a_position;
|
||||
}
|
||||
36
core/assets/shaders/slag.frag
Executable file
@@ -0,0 +1,36 @@
|
||||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
//shades of slag
|
||||
#define S2 vec3(100.0, 93.0, 49.0) / 100.0
|
||||
#define S1 vec3(100.0, 60.0, 25.0) / 100.0
|
||||
#define NSCALE 280.0 / 2.0
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
uniform sampler2D u_noise;
|
||||
|
||||
uniform vec2 u_campos;
|
||||
uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main(){
|
||||
vec2 c = v_texCoord.xy;
|
||||
vec2 coords = vec2(c.x * u_resolution.x + u_campos.x, c.y * u_resolution.y + u_campos.y);
|
||||
|
||||
float btime = u_time / 4000.0;
|
||||
float noise = (texture2D(u_noise, (coords) / NSCALE + vec2(btime) * vec2(-0.9, 0.8)).r + texture2D(u_noise, (coords) / NSCALE + vec2(btime * 1.1) * vec2(0.8, -1.0)).r) / 2.0;
|
||||
vec3 color = texture2D(u_texture, c).rgb;
|
||||
|
||||
if(noise > 0.6){
|
||||
color = S2;
|
||||
}else if(noise > 0.54){
|
||||
color = S1;
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(color.rgb, 1.0);
|
||||
}
|
||||
45
core/assets/shaders/snow.frag
Normal file
@@ -0,0 +1,45 @@
|
||||
#define LIGHT
|
||||
|
||||
#ifdef LIGHT
|
||||
#define LAYERS 30.
|
||||
#define DEPTH .5
|
||||
#define WIDTH .3
|
||||
#define SPEED .6
|
||||
#define SIZE 0.2
|
||||
#else
|
||||
#define LAYERS 200.
|
||||
#define DEPTH .1
|
||||
#define WIDTH .8
|
||||
#define SPEED 1.5
|
||||
#define SIZE 1.0
|
||||
#endif
|
||||
|
||||
varying vec2 v_texCoords;
|
||||
|
||||
uniform vec2 u_pos;
|
||||
uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
uniform sampler2D u_texture0;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = texture2D(u_texture0, v_texCoords);
|
||||
|
||||
vec2 uv = (v_texCoords * u_resolution + u_pos) / 1000.0;
|
||||
const mat3 p = mat3(
|
||||
13.3231, 23.5112, 21.7112,
|
||||
21.1212, 28.7312, 11.9312,
|
||||
21.8112, 14.7212, 61.3934
|
||||
);
|
||||
float dof = 5.*sin(u_time*.1);
|
||||
|
||||
//TODO this is very slow
|
||||
for(float i=0.0; i<LAYERS; i++){
|
||||
vec2 q = uv* (1.+i*DEPTH);
|
||||
q += vec2(q.y* WIDTH * (fract(i*7.238917) - .5), SPEED * u_time / (1.+i*DEPTH*.03));
|
||||
vec3 n = vec3(floor(q), 31.189+i), m = floor(n)/1e5 + fract(n), mp = (31.9+m) / fract(p*m), r = fract(mp);
|
||||
vec2 s = abs(fract(q)-.5 +.9*r.xy-.45) + .01*abs(2.0*fract(10.*q.yx) - 1.0);
|
||||
float d = .6 * (s.x+s.y) + max(s.x,s.y) -.01, edge = .005*SIZE + .05 * SIZE * min(.5* abs(i-5.-dof), 1.);
|
||||
|
||||
gl_FragColor += smoothstep(edge,-edge,d) * r.x / (1.+.02*i*DEPTH);
|
||||
}
|
||||
}
|
||||