Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Drunk Shader and Camera Controls + New Desaturation Shader #6832

Merged
merged 5 commits into from
Jun 21, 2021

Conversation

jamessimo
Copy link
Contributor

@jamessimo jamessimo commented Jun 20, 2021

Purpose

With Drug and Alcohol reagent processing being worked on it its about time we made the Drunk shader not place holder but a fully fleshed out. The drunk camera script now has direct control over the Sine and Cos wave length, duration and speed along with scaling light. This can be tweaked by any dev with the editor and/or C# code with no need to edit the shader directly. #6793

This also has fixed a nasty Linux visual bug that made the entire screen upside down, to counteract this I added in a check for DirectX 11 and flip the coordinates if so.

Notes:

Whiles all the controls for the drunk and desaturation shader are in, I did not hook these up to anything, that is for whoever is working on reagent consumption to do. See the CameraEffectControlScript for example about how you choose drunken level. Desaturation is just a value from 0 to 1.0. The shader code will force to 1 if you feed it a big number and 0 if you feed it a negative.

There is also a TODO to find out why some shaders conflict, if you have more than one shader the screen still inverts, not sure why as some of these shaders do not use uv.y coords. Will investigate more.

Also moved OSX/Mac to use OpenGL BEFORE metal, Metal is introducing bugs that we cannot fix so easier to put them on the same pipeline as Linux users. #4537

Changelog:

CL: [Improvement] Made the drunk view more tame like you are drunk and not tripping on antifreeze and mercury.
CL: [Fix] Fixes the drunk shader being upside-down for OpenGL machines (Linux and some mac) #4542

James added 3 commits June 20, 2021 20:37
To support the new alcohol reagent work I have boosted the drunken camera script to now manage many different stages of being drunk as
 well as exposing many shader variables

Added a greyscale shader and camera manager to support loosing vision when you loose blood

Changed graphics APIs for Mac to target OpenGL first to fix issues with rendering shaders

Added checks for DirectX to fix shader issues on Linux

unitystation#4542
unitystation#4537
unitystation#4717
Fix clone spam
No idea why but drunk shader and greyscale dont get on, it inverts the view
@github-actions github-actions bot added the Scene Changes Any changes that affect scenes (e.g. lobby or maps) label Jun 20, 2021
@pyrosshade
Copy link
Contributor

why is the vomiting bounty linked?

@jamessimo
Copy link
Contributor Author

why is the vomiting bounty linked?

Sorry was a mistake. Removed.

Make Codacy a happy boi
Copy link
Contributor

@ThatDan123 ThatDan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't changed the camera prefab only the online scene

forgot to add this like a dingus
@Bod9001 Bod9001 merged commit a567b4e into unitystation:develop Jun 21, 2021
Bod9001 added a commit that referenced this pull request Jun 29, 2021
* Body slots

* Fixing up rebase

* Part one of the Requested changes and handcuffs now work

* Fixes captain's hat

* Added more comments and stuff

* Some more comments

* Fixes tests?

* Thanks Codacy

* Fixer slot interactions and makes clothing collapsible

* Fixers compile error

* humm, This should have deleted it?

* rearranging

* name spaces

* fixed

* updated

* fixes

* fixed merge

* Squashed commit of the following:

commit dbedaad
Author: GitHub Action <action@github.com>
Date:   Tue Jun 29 10:25:32 2021 +0000

    misc: update Changelog

commit 65c7036
Author: ThatDan123 <56727168+ThatDan123@users.noreply.github.com>
Date:   Tue Jun 29 11:21:52 2021 +0100

    AI Job (#6626)

    * Basics

    * More stuff

    * display stuff

    * Fixes

    * fix interaction

    * player semi ghost clean up

    * Interaction script stuff

    * fire alarm, door switch

    * Law tab

    * State Laws

    * Camera Stuff

    * Linecast checks for netUI

    * Character customisation and camera power

    * more power stuff

    * Hook AI up to nearest APC

    * Update AiPlayer.cs

    * Hud stuff

    * Floor bolt toggle and call shuttle

    * Push fix

    * Camera Teleport

    * Teleport

    * Ai Track player and mob

    * Old doors/Windoor interaction

    * emitter

    * Camera Light decrease

    * Fix law screen issue

    * focus fix

    * Apc check for future use

    * comment out future code for AI core

    * Update UI_Ai.cs

    * Send local chat to core if near core not ai camera position

    * Test fix

    * cooldown fix

    * Stop blob and cargonia being AI

    * Law Sets

    * Camera Saving

    * Show objectives and restrict Ai traitor to obtainable objectives, sorry Ai you have no hands

    * Codacy Fixes

    * Hud fixes and interaction visualisation

    * fix admin spectator ghost

    * Law Modules and Upload console

    * Input field for module

    * Fix law length check

    * upload console construction

    * Codacy stuff, except playerscript namespace

    * Update ControlTabs.cs

    * Refactor law syncing, adds number of laws to UI

    * reset fix

    * Turret Frame Stuff

    * States and item traits

    * Turret Switch

    * Fixes

    * Fixes

    * Integrity and armor updated

    * Construction Fixes

    * Refactor power set up

    * Fixes

    * Last fixes

    * Spawn fixes

    * remove extra ;

    * Number of active cameras

    * Turret Controller NetTab

    * InteliCard part 1

    * Intelicard net tab

    * Fixes

    * more fixes

    * test fix

    * Codacy

    * Ai Core Frame construction

    * Update CircuitImprinterProducts.asset

    * Fixes

    * test fix

    * Validation line colour and some other interaction

    * Airlock Ai Ui

    * Fixes #6753

    * Clean up and camera arrow movement.

    * Fix spelling

    * Fixes

    * Admin info fix

    * obj

    * Fix Conflicts

    * Turret settings

    * Update GUI_Airlock.cs

    * Input fix

    * Door bolt sound integration

    * Ballistic Turret

    * Fix merge conflicts

    * Update UIManager.prefab

    * Spawn Sound

commit 2f9974f
Author: Gilles <43683714+corp-0@users.noreply.github.com>
Date:   Tue Jun 29 04:59:51 2021 -0400

    change version of pr2changelog

    I broke that shit on master

commit 1f5d871
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Mon Jun 28 18:34:14 2021 -0300

    Fixes self-hit when spamclicking (#6864)

    * Moves hiticons out from player prefabs into SpriteManager.
    Hit icons will now be pooled in the SpriteHandlerManager.
    Fixes the hiticons being target of interactions, which was making players hit themselves when spamclicking a target.

    * Adds the HitIcon prefab to the NetworkManager.
    Moves the HitIcon spawn away from the SpriteHandlerManager, it'll now use the Spawn and Despawn classes utilizing their client only functions.

commit 20a7d67
Author: GitHub Action <action@github.com>
Date:   Mon Jun 28 20:55:24 2021 +0000

    misc: update Changelog

commit aebf903
Author: NoooneyDude <noooneydude@gmail.com>
Date:   Tue Jun 29 08:51:29 2021 +1200

    Assorted enhancements (#6870)

commit 9eb08d8
Author: Akbadain29 <luckycannonfodder@gmail.com>
Date:   Mon Jun 28 18:45:40 2021 +1000

    Update three different documentation pages (#6862)

    * Update three different documentation pages

    * Apply suggestions from code review

    Co-authored-by: NoooneyDude <noooneydude@gmail.com>

commit 76b42e7
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Mon Jun 28 05:39:13 2021 -0300

    Hotfixes a server crash when a new player joins in an ongoing round with where coloured graffitis have been laid down. (#6868)

commit 9637176
Author: GitHub Action <action@github.com>
Date:   Mon Jun 28 08:22:13 2021 +0000

    misc: update Changelog

commit 9ee4b91
Author: PetMudstone <38266309+PetMudstone@users.noreply.github.com>
Date:   Mon Jun 28 01:18:34 2021 -0700

    Placing collision sensors and RCS on ancient station shuttle. (#6863)

commit 93bf4f8
Author: Bod9001 <Bod9001@gmail.com>
Date:   Sun Jun 27 22:09:08 2021 +0100

    Surgery fixes (#6865)

commit 85f80b6
Author: Bod9001 <Bod9001@gmail.com>
Date:   Sat Jun 26 14:28:11 2021 +0100

    Body parts now have customisations tied to the body part When set  (#6860)

    * Fixes mixer prefab and convert sprite handler  Message to use reader and writer

    * Body parts now have customisations tied to the body part When set

commit 9f98cfe
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Sat Jun 26 10:27:42 2021 -0300

    Fixes admin storage items being invisible on the UI. (#6859)

commit 8482b91
Author: Bod9001 <Bod9001@gmail.com>
Date:   Sat Jun 26 01:40:39 2021 +0100

    Fixes mixer prefab and convert sprite handler  Message to use reader and writer (#6858)

commit d0a48d3
Author: GitHub Action <action@github.com>
Date:   Fri Jun 25 20:39:06 2021 +0000

    misc: update Changelog

commit d0178fb
Author: PerfectTangent <68730437+PerfectTangent@users.noreply.github.com>
Date:   Fri Jun 25 16:35:50 2021 -0400

    Update Outpost to Doors V2 and adds security cameras, add tools and mats to Fall and Square (#6857)

    * added mats to fall and square,

    * did 1/3rd of Outpost's doors, reworked service dorms.

    * did command, medical, and west areas.

    * did more of outpost maint and halls

    * all doors switched

    * did door access and 3/4 of the cameras, added emergency storage

    * finished outpost cameras, fixed spawn point in Fall

    * fixed null values, added a handful of lights. to outpost and Fall

    * added more mats to Outpost

commit 2164e7c
Author: GitHub Action <action@github.com>
Date:   Fri Jun 25 10:26:13 2021 +0000

    misc: update Changelog

commit ffb8132
Author: PetMudstone <38266309+PetMudstone@users.noreply.github.com>
Date:   Fri Jun 25 03:22:17 2021 -0700

    Fixing sprites for cyborg and surplus prosthetic limbs. (#6855)

commit e597c42
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Fri Jun 25 07:22:00 2021 -0300

    Cleans up the duplicate calls for CanApply() and CanInteract() in Validations code as well as some clearing some code in DefaultWillInteract. (#6854)

    Now interactions will go through way less loops making it easier to debug and read.

commit 754e6a5
Author: Bod9001 <Bod9001@gmail.com>
Date:   Fri Jun 25 11:20:09 2021 +0100

    Let's hope this works (#6852)

commit 427f8dd
Author: James Simonson <jamessimo89@gmail.com>
Date:   Thu Jun 24 00:19:39 2021 +0800

    Update Mop.cs (#6848)

    Fixes issue #6828 by removing cleaning reagents when used

    Co-authored-by: James <jamessimo@outlook.com>

commit 746b911
Author: Bod9001 <Bod9001@gmail.com>
Date:   Wed Jun 23 17:19:11 2021 +0100

    fixes people spontaneously suffocating (#6849)

    * players now will no longer develop Lung and heart cancer

    * made body parts moore forgiving

    * Now properly fixed, turns out cancers hard to get rid of

    * updated SO

commit b466200
Author: James Simonson <jamessimo89@gmail.com>
Date:   Wed Jun 23 15:04:49 2021 +0800

    fix upside down shader on DX10 systems (#6847)

    * fix upside down shader on DX10 systems

    * Removed active grey camera and made shader DX agnostic

    * Apply suggestions from code review

    Co-authored-by: James <jamessimo@outlook.com>
    Co-authored-by: NoooneyDude <noooneydude@gmail.com>

commit dcbe6a2
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Tue Jun 22 20:28:05 2021 -0300

    Fixes fires getting stuck in the case of a runtime happening during a fire exposure. (#6844)

    Removes the queue and semi-lock system from TileList to apply actions, replaced it with a temp list instead.

commit e5e046e
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Tue Jun 22 20:26:42 2021 -0300

    Fixes explosions getting stuck in a loop in the case of a runtime happening when a explosion node is processing. (#6846)

commit 70883ae
Author: Bod9001 <Bod9001@gmail.com>
Date:   Tue Jun 22 21:41:15 2021 +0100

    General fixes (#6843)

    * General fixes

    * Remove unneeded check

commit 458f78c
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Tue Jun 22 16:32:29 2021 -0300

    Fixes traitors having some uplink items missing from their PDAs. (#6845)

commit 6f0b693
Author: GitHub Action <action@github.com>
Date:   Tue Jun 22 08:05:52 2021 +0000

    misc: update Changelog

commit dae0e02
Author: PetMudstone <38266309+PetMudstone@users.noreply.github.com>
Date:   Tue Jun 22 01:02:47 2021 -0700

    Adjust deconstruction for rod giving tiles. (#6842)

commit 23e5c53
Author: Pyrosshade <willofshadow@gmail.com>
Date:   Tue Jun 22 02:55:49 2021 -0400

    Hold the data structure please (#6841)

    * Enabling Physics2D for ambience colliders

    * Physics2D simulation mode changed from script to update
    * Physics2d y axis gravity changed to 0

    * Etlwwtl is fun but clearing it outside the loop is even more so

    * just adding spacing so teh file reads better

    woops

commit 11a14b2
Author: GitHub Action <action@github.com>
Date:   Mon Jun 21 21:09:45 2021 +0000

    misc: update Changelog

commit a567b4e
Author: James Simonson <jamessimo89@gmail.com>
Date:   Tue Jun 22 05:06:17 2021 +0800

    Better Drunk Shader and Camera Controls + New Desaturation Shader  (#6832)

    * Drunken Shader fixes & upgrades + Greyscale shader work

    To support the new alcohol reagent work I have boosted the drunken camera script to now manage many different stages of being drunk as
     well as exposing many shader variables

    Added a greyscale shader and camera manager to support loosing vision when you loose blood

    Changed graphics APIs for Mac to target OpenGL first to fix issues with rendering shaders

    Added checks for DirectX to fix shader issues on Linux

    #4542
    #4537
    #4717

    * Update OnlineScene.unity

    Fix clone spam

    * Add a TODO over shader conflicts

    No idea why but drunk shader and greyscale dont get on, it inverts the view

    * Update GreyscaleCamera.cs

    Make Codacy a happy boi

    * Update Camera.prefab

    forgot to add this like a dingus

    Co-authored-by: James <jamessimo@outlook.com>

commit bbbd2a4
Author: Aranclanos <Aranclanos@hotmail.com>
Date:   Mon Jun 21 18:03:38 2021 -0300

    Fixes client overlays not being removed (#6837)

    * Removes the unused 'RemoveAll' argument and variables in tile update changes code.
    Removes RemoveOverlaysOfName() and GetOverlayPosByName(), all overlay removals will now use OverlayType instead.
    All remove overlay server functions will now be thread safe.
    Separates the update tile message and remove tile message in SpawnSafeThread into two.
    Fixes clients not removing certain specific overlays.

    * Moves the OverlayType enum  to the TileManagement namespace.

commit 1fe5fca
Author: PerfectTangent <68730437+PerfectTangent@users.noreply.github.com>
Date:   Mon Jun 21 17:01:00 2021 -0400

    random item pool improvements (#6838)

commit 4c428fd
Author: Bod9001 <Bod9001@gmail.com>
Date:   Mon Jun 21 22:00:41 2021 +0100

    forgot to commit a change (#6839)

    * fixes a few staging Errors

    * Gas should be equally distributed now

    * Request a change

    * Editing the loop while within the loop is fun

    * Last-minute fix

commit e2ea694
Author: Bod9001 <Bod9001@gmail.com>
Date:   Mon Jun 21 16:54:32 2021 +0100

    fixes a few staging Errors (#6833)

    * fixes a few staging Errors

    * Gas should be equally distributed now

    * Request a change

    * Editing the loop while within the loop is fun

commit bd1320a
Author: ThatDan123 <56727168+ThatDan123@users.noreply.github.com>
Date:   Sun Jun 20 12:57:10 2021 +0100

    Readd custom log json to gitignore

* Few more fixes

* So many conflicts So many times

* Fixes Players Re-spawning With old inventory
@jamessimo jamessimo deleted the Vision-Shaders branch December 5, 2021 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scene Changes Any changes that affect scenes (e.g. lobby or maps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drunk effect inverts camera on linux Drunk effect doesn't work on Mac, maybe?
4 participants