Remove Unneeded RenderTextures (#399)

* remove unneeded render textures

* remove debug print

* show build guid in parts of app

* adjust timing window
This commit is contained in:
minenice55 2023-04-23 15:27:23 -04:00 committed by GitHub
parent 98401cb786
commit 3ccedd6010
12 changed files with 496 additions and 927 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,18 +3,18 @@ guid: 009d6562d17269f48a37c11edef6b58f
TextureImporter: TextureImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}
serializedVersion: 11 serializedVersion: 12
mipmaps: mipmaps:
mipMapMode: 0 mipMapMode: 1
enableMipMap: 0 enableMipMap: 1
sRGBTexture: 1 sRGBTexture: 1
linearTexture: 0 linearTexture: 0
fadeOut: 0 fadeOut: 1
borderMipMap: 0 borderMipMap: 1
mipMapsPreserveCoverage: 0 mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5 alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1 mipMapFadeDistanceStart: 7
mipMapFadeDistanceEnd: 3 mipMapFadeDistanceEnd: 10
bumpmap: bumpmap:
convertToNormalMap: 0 convertToNormalMap: 0
externalNormalMap: 0 externalNormalMap: 0
@ -24,6 +24,7 @@ TextureImporter:
streamingMipmaps: 0 streamingMipmaps: 0
streamingMipmapsPriority: 0 streamingMipmapsPriority: 0
vTOnly: 0 vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
@ -50,9 +51,9 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1 spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1 alphaUsage: 1
alphaIsTransparency: 1 alphaIsTransparency: 0
spriteTessellationDetail: -1 spriteTessellationDetail: -1
textureType: 8 textureType: 0
textureShape: 1 textureShape: 1
singleChannelComponent: 0 singleChannelComponent: 0
flipbookRows: 1 flipbookRows: 1
@ -62,6 +63,7 @@ TextureImporter:
textureFormatSet: 0 textureFormatSet: 0
ignorePngGamma: 0 ignorePngGamma: 0
applyGammaDecoding: 0 applyGammaDecoding: 0
cookieLightType: 1
platformSettings: platformSettings:
- serializedVersion: 3 - serializedVersion: 3
buildTarget: DefaultTexturePlatform buildTarget: DefaultTexturePlatform
@ -99,6 +101,18 @@ TextureImporter:
overridden: 0 overridden: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []
@ -112,6 +126,7 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
nameFileIdTable: {}
spritePackingTag: spritePackingTag:
pSDRemoveMatte: 0 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0 pSDShowRemoveMatteOption: 0

View file

@ -1,8 +1,8 @@
using System; using System;
public static class AppInfo { public static class AppInfo {
public const string Version = "0.0.968"; public const string Version = "0.0.969";
public static readonly DateTime Date = new DateTime(2023, 02, 09, 01, 03, 08, 186, DateTimeKind.Utc); public static readonly DateTime Date = new DateTime(2023, 04, 23, 17, 57, 04, 196, DateTimeKind.Utc);
} }

View file

@ -30,6 +30,7 @@ namespace HeavenStudio
public static Vector3 defaultPosition = new Vector3(0, 0, -10); public static Vector3 defaultPosition = new Vector3(0, 0, -10);
public static Vector3 defaultRotEluer = new Vector3(0, 0, 0); public static Vector3 defaultRotEluer = new Vector3(0, 0, 0);
public static Vector3 defaultShake = new Vector3(0, 0, 0); public static Vector3 defaultShake = new Vector3(0, 0, 0);
public static float defaultFoV = 53.15f;
/** /**
camera's current transformation camera's current transformation
@ -53,6 +54,7 @@ namespace HeavenStudio
public static Vector3 additionalPosition; public static Vector3 additionalPosition;
public static Vector3 additionalRotEluer; public static Vector3 additionalRotEluer;
public static Vector3 additionalScale; public static Vector3 additionalScale;
public static float additionalFoV;
[Header("Components")] [Header("Components")]
public Color baseColor; public Color baseColor;
@ -109,8 +111,11 @@ namespace HeavenStudio
SetShakeIntensity(); SetShakeIntensity();
Camera cam = GetCamera(); Camera cam = GetCamera();
cam.transform.localPosition = position + additionalPosition + shakeResult; // rotate position by additional rotation
Vector3 userPos = Quaternion.Euler(additionalRotEluer) * position;
cam.transform.localPosition = userPos + additionalPosition + shakeResult;
cam.transform.eulerAngles = rotEluer + additionalRotEluer; cam.transform.eulerAngles = rotEluer + additionalRotEluer;
cam.fieldOfView = additionalFoV;
} }
private void UpdateCameraTranslate() private void UpdateCameraTranslate()
@ -238,6 +243,7 @@ namespace HeavenStudio
{ {
additionalPosition = new Vector3(0, 0, 0); additionalPosition = new Vector3(0, 0, 0);
additionalRotEluer = new Vector3(0, 0, 0); additionalRotEluer = new Vector3(0, 0, 0);
additionalFoV = defaultFoV;
} }
public static Camera GetCamera() public static Camera GetCamera()

View file

@ -53,12 +53,11 @@ namespace HeavenStudio.Games
public enum BTSObject { HitPieces, MissPieces, FlyingRod } public enum BTSObject { HitPieces, MissPieces, FlyingRod }
[Header("Camera")] [Header("Camera")]
public Transform renderQuadTrans; [SerializeField] Transform camPos;
public Transform camPivot; [SerializeField] float cameraFoV;
public Camera camComp;
[Header("References")] [Header("References")]
public SkinnedMeshRenderer environmentRenderer; [SerializeField] SkinnedMeshRenderer environmentRenderer;
public GameObject flyingRodBase; public GameObject flyingRodBase;
public GameObject movingBlocksBase; public GameObject movingBlocksBase;
public GameObject hitPartsBase; public GameObject hitPartsBase;
@ -69,7 +68,7 @@ namespace HeavenStudio.Games
public Animator elevatorAnim; public Animator elevatorAnim;
[Header("Properties")] [Header("Properties")]
public float beltSpeed = 1f; [SerializeField] float beltSpeed = 1f;
private Material beltMaterial; private Material beltMaterial;
private Material[] environmentMaterials; private Material[] environmentMaterials;
@ -87,18 +86,17 @@ namespace HeavenStudio.Games
environmentMaterials = environmentRenderer.materials; environmentMaterials = environmentRenderer.materials;
beltMaterial = Instantiate(environmentMaterials[8]); beltMaterial = Instantiate(environmentMaterials[8]);
environmentMaterials[8] = beltMaterial; environmentMaterials[8] = beltMaterial;
renderQuadTrans.gameObject.SetActive(true);
var cam = GameCamera.instance.camera;
var camHeight = 2f * cam.orthographicSize;
var camWidth = camHeight * cam.aspect;
renderQuadTrans.localScale = new Vector3(camWidth, camHeight, 1f);
camComp.depthTextureMode = camComp.depthTextureMode | DepthTextureMode.Depth;
elevatorAnim.Play("MakeRod", 0, 1f); elevatorAnim.Play("MakeRod", 0, 1f);
} }
private void Start()
{
GameCamera.additionalPosition = camPos.position + (Quaternion.Euler(camPos.eulerAngles) * Vector3.forward * 10f);
GameCamera.additionalRotEluer = camPos.eulerAngles;
GameCamera.additionalFoV = cameraFoV;
}
List<DynamicBeatmap.DynamicEntity> spawnedBlockEvents = new List<DynamicBeatmap.DynamicEntity>(); List<DynamicBeatmap.DynamicEntity> spawnedBlockEvents = new List<DynamicBeatmap.DynamicEntity>();
void Update() void Update()
{ {

View file

@ -334,7 +334,6 @@ namespace HeavenStudio.Games
{ {
if (path.name == name) if (path.name == name)
{ {
Debug.Log("Found path " + name);
return path; return path;
} }
} }

View file

@ -9,7 +9,7 @@ namespace HeavenStudio.Games
{ {
public class Minigame : MonoBehaviour public class Minigame : MonoBehaviour
{ {
public static double earlyTime = 0.07f, perfectTime = 0.04f, aceEarlyTime = 0.01f, aceLateTime = 0.01f, lateTime = 0.04f, endTime = 0.07f; public static double earlyTime = 0.075f, perfectTime = 0.06f, aceEarlyTime = 0.01f, aceLateTime = 0.01f, lateTime = 0.06f, endTime = 0.075f;
public static float rankHiThreshold = 0.8f, rankOkThreshold = 0.6f; public static float rankHiThreshold = 0.8f, rankOkThreshold = 0.6f;
[SerializeField] public SoundSequence.SequenceKeyValue[] SoundSequences; [SerializeField] public SoundSequence.SequenceKeyValue[] SoundSequences;

View file

@ -112,9 +112,9 @@ namespace HeavenStudio.Games
public enum RallySpeed { Slow, Normal, Fast, SuperFast } public enum RallySpeed { Slow, Normal, Fast, SuperFast }
[Header("Camera")] [Header("Camera")]
public Transform renderQuadTrans; [SerializeField] Transform cameraPivot;
public Transform cameraPivot; [SerializeField] Transform cameraPos;
[SerializeField] float cameraFOV;
[Header("Ball and curve info")] [Header("Ball and curve info")]
public GameObject ball; public GameObject ball;
@ -155,12 +155,6 @@ namespace HeavenStudio.Games
{ {
instance = this; instance = this;
paddlers.Init(); paddlers.Init();
renderQuadTrans.gameObject.SetActive(true);
var cam = GameCamera.instance.camera;
var camHeight = 2f * cam.orthographicSize;
var camWidth = camHeight * cam.aspect;
renderQuadTrans.localScale = new Vector3(camWidth, camHeight, 1f);
playerAnim.Play("Idle", 0, 0); playerAnim.Play("Idle", 0, 0);
opponentAnim.Play("Idle", 0, 0); opponentAnim.Play("Idle", 0, 0);
@ -180,9 +174,6 @@ namespace HeavenStudio.Games
var playerState = playerAnim.GetCurrentAnimatorStateInfo(0); var playerState = playerAnim.GetCurrentAnimatorStateInfo(0);
var opponentState = opponentAnim.GetCurrentAnimatorStateInfo(0); var opponentState = opponentAnim.GetCurrentAnimatorStateInfo(0);
bool playerPrepping = false; // Player using prep animation?
bool opponentPrepping = false; // Opponent using prep animation?
if (started) if (started)
{ {
// Determine hitBeat and beatDurs. // Determine hitBeat and beatDurs.
@ -319,13 +310,11 @@ namespace HeavenStudio.Games
{ {
if (served) if (served)
{ {
playerPrepping = true;
if ((playerState.IsName("Swing") && playerAnim.IsAnimationNotPlaying()) || (!playerState.IsName("Swing") && !playerState.IsName("Ready1"))) if ((playerState.IsName("Swing") && playerAnim.IsAnimationNotPlaying()) || (!playerState.IsName("Swing") && !playerState.IsName("Ready1")))
playerAnim.Play("Ready1"); playerAnim.Play("Ready1");
} }
else if (!opponentServing) else if (!opponentServing)
{ {
opponentPrepping = true;
if ((opponentState.IsName("Swing") && opponentAnim.IsAnimationNotPlaying()) || (!opponentState.IsName("Swing") && !opponentState.IsName("Ready1"))) if ((opponentState.IsName("Swing") && opponentAnim.IsAnimationNotPlaying()) || (!opponentState.IsName("Swing") && !opponentState.IsName("Ready1")))
{ {
opponentAnim.Play("Ready1"); opponentAnim.Play("Ready1");
@ -367,6 +356,11 @@ namespace HeavenStudio.Games
} }
opponentServing = false; opponentServing = false;
//update camera
GameCamera.additionalPosition = cameraPos.position + (Quaternion.Euler(cameraPos.rotation.eulerAngles) * Vector3.forward * 10f);
GameCamera.additionalRotEluer = cameraPos.rotation.eulerAngles;
GameCamera.additionalFoV = cameraFOV;
} }
public void Bop(float beat, float length, bool bop, bool bopAuto) public void Bop(float beat, float length, bool bop, bool bopAuto)

View file

@ -98,16 +98,18 @@ namespace HeavenStudio
Init(); Init();
DontDestroyOnLoad(this.gameObject); DontDestroyOnLoad(this.gameObject);
instance = this; instance = this;
Starpelly.OS.ChangeWindowTitle("Heaven Studio DEMO");
QualitySettings.maxQueuedFrames = 1; QualitySettings.maxQueuedFrames = 1;
PlayerInput.InitInputControllers(); PlayerInput.InitInputControllers();
#if UNITY_EDITOR #if UNITY_EDITOR
Starpelly.OS.ChangeWindowTitle("Heaven Studio UNITYEDITOR ");
buildTime = "(EDITOR) " + System.DateTime.UtcNow.ToString("dd/MM/yyyy hh:mm:ss"); buildTime = "(EDITOR) " + System.DateTime.UtcNow.ToString("dd/MM/yyyy hh:mm:ss");
#else #else
buildTime = AppInfo.Date.ToString("dd/MM/yyyy hh:mm:ss"); Starpelly.OS.ChangeWindowTitle("Heaven Studio (INDEV) " + Application.buildGUID.Substring(0, 8));
buildTime = Application.buildGUID.Substring(0, 8) + " " + AppInfo.Date.ToString("dd/MM/yyyy hh:mm:ss");
#endif #endif
} }
// todo: make this part of the camera prefab instead of generated in code
public static GameObject CreateFade() public static GameObject CreateFade()
{ {
GameObject fade = new GameObject(); GameObject fade = new GameObject();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

View file

@ -1,96 +0,0 @@
fileFormatVersion: 2
guid: 328837ad253d9904d9b449a50b0b7917
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: