Skip to content

Commit

Permalink
v0.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpineda committed Sep 10, 2023
1 parent 4ec9c35 commit 1bcb470
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 61 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.6.9] - 2023-09-10

## Added

- Two more macros oriented around following / unfollowing units
Expand All @@ -22,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Changed

- API namespace finalized to @titan-reactor-runtime/ui and @titan-reactor-runtime/native
- Plugin file structure has changed so that typescript types can be used

## [0.6.8] - 2022-12-21

Expand Down Expand Up @@ -305,7 +308,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Good support for HD2/HD terrain, sluggish first render time, on the todo list.
- Unit selection / unit boxing for the time being.

[unreleased]: https://github.com/imbateam-gg/titan-reactor/compare/v0.6.8...HEAD
[unreleased]: https://github.com/imbateam-gg/titan-reactor/compare/v0.6.9...HEAD
[0.6.9]: https://github.com/imbateam-gg/titan-reactor/compare/v0.6.8...v0.6.9
[0.6.8]: https://github.com/imbateam-gg/titan-reactor/compare/v0.6.7...v0.6.8
[0.6.7]: https://github.com/imbateam-gg/titan-reactor/compare/v0.6.6...v0.6.7
[0.6.6]: https://github.com/imbateam-gg/titan-reactor/compare/v0.6.5...v0.6.6
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
],
"appId": "imbateam.titan-reactor",
"productName": "Titan Reactor",

"mac": {
"category": "An OpenBW Renderer"
},
Expand All @@ -54,7 +53,8 @@
"from": "bundled",
"to": "bundled"
}
]
],
"electronDist": "C:\\Users\\Game_Master\\Projects\\electron\\src\\out\\zip"
},
"debug": {
"env": {
Expand Down Expand Up @@ -102,7 +102,7 @@
"node-fetch": "3.2.10",
"pacote": "^14.0.0",
"pkware-wasm": "^1.0.0",
"postprocessing": "6.30.2",
"postprocessing": "6.32.2",
"random": "^3.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down Expand Up @@ -151,7 +151,7 @@
"@typescript-eslint/parser": "^5.1.0",
"@vitejs/plugin-react": "^2.1.0",
"dotenv": "^16.0.3",
"electron": "^25.2.0",
"electron": "26.2.0",
"electron-builder": "^23.3.3",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
1 change: 0 additions & 1 deletion src/main/acl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export function initACLs() {
// Check working directory's existing ACLs against our list of ACL strings
child_process.exec( `icacls ${execPath}`, null, ( _, output ) => {
const existing_acls = output.toString();
console.log( existing_acls)
const missing_acls = ACL_STRINGS.filter(
( acl ) => !existing_acls.includes( acl )
);
Expand Down
3 changes: 0 additions & 3 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@ async function start(){
const psbId = powerSaveBlocker.start( "prevent-display-sleep" );

app.commandLine.appendSwitch( "enable-features", "SharedArrayBuffer" );
app.commandLine.appendSwitch( "enable-features", "WebXR" );
app.commandLine.appendSwitch( "force_high_performance_gpu" );
// app.commandLine.appendSwitch( "disable-xr-sandbox" );
app.commandLine.appendSwitch( "strict-origin-isolation" );
app.commandLine.appendSwitch( "js-flags", "--expose-gc" );
app.commandLine.appendSwitch( "disable-gpu-process-crash-limit" );
app.commandLine.appendSwitch( "enable-logging=file" );
app.commandLine.appendSwitch( "trace-warnings" );
// app.commandLine.appendSwitch( "no-sandbox" );

app.disableDomainBlockingFor3DAPIs();

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/core/world/postprocessing-composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export const createPostProcessingComposer = (
v.shakeEnd();
}

renderComposer.renderBuffer();
renderComposer.drawBuffer();
},
};
};
13 changes: 12 additions & 1 deletion src/renderer/render/render-composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const createWebGLRenderer = () => {
} );
renderer.outputEncoding = sRGBEncoding;
renderer.debug.checkShaderErrors = process.env.NODE_ENV === "development";
renderer.xr.enabled = true;

renderer.shadowMap.enabled = true;
renderer.shadowMap.type = VSMShadowMap;
Expand Down Expand Up @@ -109,23 +110,33 @@ export class TitanRenderComposer {
this.setSize( surface.bufferWidth, surface.bufferHeight );
}

/**
* Renders the scene to the screen.
* If a viewport is provided, only that part of the screen will be rendered to.
*/
render( delta: number, viewport?: Vector4 ) {
const renderer = this.getWebGLRenderer();

// If a viewport is provided, we need to enable the scissor test so that only that part of the screen is rendered to.
if ( viewport ) {
renderer.setScissorTest( true );
renderer.setViewport( viewport );
renderer.setScissor( viewport );
}

// Render the scene using the post-processing pipeline.
this.composer.render( delta );

// If a viewport is provided, we need to disable the scissor test so that the rest of the screen is rendered to as well.
if ( viewport ) {
renderer.setScissorTest( false );
}
}

renderBuffer() {
/**
* Copies the contents of the renderer to the target surface.
*/
drawBuffer() {
const renderer = this.getWebGLRenderer();
const surface = this.#surfaceRef.deref();

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/scenes/home/home-scene-loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export async function homeSceneLoader(): Promise<SceneState> {
const janitor = new Janitor( "home-scene-loader" );
log.debug( "Loading home scene" );

const wraithScene = janitor.mop(await createWraithScene());
root.render( <Home surface={getSurface().canvas} /> );
const wraithScene = janitor.mop(await createWraithScene());
setTimeout( () => wraithScene.resize(), 500);

const swoosh = mixer.context.createBufferSource();
Expand Down
62 changes: 22 additions & 40 deletions src/renderer/scenes/home/space-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ToneMappingEffect,
VignetteEffect,
} from "postprocessing";
import { VRButton } from 'three/examples/jsm/webxr/VRButton';
// import { VRButton } from 'three/examples/jsm/webxr/VRButton';
import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";

import {
Expand Down Expand Up @@ -45,11 +45,7 @@ CameraControls.install( { THREE: THREE } );

const camera = createCamera();
const introSurface = new Surface();
const controls = new CameraControls( camera.get(), document.body );
controls.maxPolarAngle = Infinity;
controls.minPolarAngle = -Infinity;
controls.maxAzimuthAngle = Infinity;
controls.minAzimuthAngle = -Infinity;
let _controls: CameraControls;

const chromaticAberrationEffect = new ChromaticAberrationEffect();
const glitchMax = new Vector2( 0.05, 0.08 );
Expand All @@ -76,15 +72,15 @@ const INTRO_LOOP = ( elapsed: number ) => {
const delta = elapsed - _lastElapsed;
_lastElapsed = elapsed;

controls.update( delta / 1000 );
_controls.update( delta / 1000 );

const azimuth = THREE.MathUtils.euclideanModulo(
controls.azimuthAngle,
_controls.azimuthAngle,
360 * THREE.MathUtils.DEG2RAD
);
const rear = azimuth < Math.PI ? azimuth / Math.PI : 2 - azimuth / Math.PI;

camera.update( delta, controls, azimuth, mouse );
camera.update( delta, _controls, azimuth, mouse );

wraiths.update(
delta,
Expand All @@ -107,7 +103,7 @@ const INTRO_LOOP = ( elapsed: number ) => {
camera.cameraState === CameraState.RotateAroundWraiths ? rear : 0;

renderComposer.render( delta );
renderComposer.renderBuffer();
renderComposer.drawBuffer();
};

const _sceneResizeHandler = () => {
Expand Down Expand Up @@ -148,14 +144,7 @@ const _mousemove = ( ev: MouseEvent ) => {

export const getSurface = () => introSurface;

// window._clap = () => {
// console.log("position", controls.getPosition());
// console.log("target", controls.getTarget());
// console.log("zoom", _zoom)
// }

let _noiseInstance: WraithNoise;

let _runs = 0;

export async function createWraithScene() {
Expand All @@ -168,6 +157,12 @@ export async function createWraithScene() {
_noiseInstance = janitor.mop( createWraithNoise() );
_noiseInstance.start();

_controls = janitor.mop(new CameraControls( camera.get(), document.body ));
_controls.maxPolarAngle = Infinity;
_controls.minPolarAngle = -Infinity;
_controls.maxAzimuthAngle = Infinity;
_controls.minAzimuthAngle = -Infinity;

janitor.addEventListener( window, "resize", "resize", _sceneResizeHandler, {
passive: true,
} );
Expand All @@ -182,16 +177,12 @@ export async function createWraithScene() {
wraiths.init();
scene.add( janitor.mop( wraiths.object ) );

// janitor.mop(wraiths, "wraiths");
janitor.mop( battleCruiser.particles.object );
janitor.mop( wraiths.particles.object );

scene.add( janitor.mop( distantStars() ) );

scene.add( janitor.mop( battleCruiser.object ) );

scene.add( janitor.mop( asteroids.object ) );

scene.add( janitor.mop( battleLights.object ) );

const playRemixInterval = setInterval( () => {
Expand All @@ -202,20 +193,14 @@ export async function createWraithScene() {
const slight = new DirectionalLight( 0xffffff, 5 );
scene.add( slight );

introSurface.setDimensions( window.innerWidth, window.innerHeight, devicePixelRatio );
renderComposer.targetSurface = introSurface;

camera.get().aspect = introSurface.width / introSurface.height;
camera.get().updateProjectionMatrix();
_controls.setLookAt( -3.15, 1.1, -0.7, 0, 0, 0, false );
_controls.zoomTo( 1.75, false );
_controls.mouseButtons.left = 0;
_controls.mouseButtons.right = 0;
_controls.mouseButtons.middle = 0;
_controls.mouseButtons.wheel = 0;

controls.setLookAt( -3.15, 1.1, -0.7, 0, 0, 0, false );
controls.zoomTo( 1.75, false );
controls.mouseButtons.left = 0;
controls.mouseButtons.right = 0;
controls.mouseButtons.middle = 0;
controls.mouseButtons.wheel = 0;

janitor.mop( camera.init( controls, battleCruiser.object ), "camera" );
janitor.mop( camera.init( _controls, battleCruiser.object ), "camera" );

const renderPass = janitor.mop( new RenderPass( scene, camera.get() ) );
const sunMaterial = new MeshBasicMaterial( {
Expand Down Expand Up @@ -275,17 +260,14 @@ export async function createWraithScene() {
] ),
} );

renderComposer.getWebGLRenderer().xr.enabled = true;
renderComposer.getWebGLRenderer().compile( scene, camera.get() );

renderComposer.render( 0 );
renderComposer.renderBuffer();
renderComposer.getWebGLRenderer().setAnimationLoop( INTRO_LOOP );
janitor.mop( () => {
renderComposer.getWebGLRenderer().setAnimationLoop( null );
}, "renderLoop" );

document.body.appendChild( VRButton.createButton( renderComposer.getWebGLRenderer() ) );
_sceneResizeHandler();

// document.body.appendChild( VRButton.createButton( renderComposer.getWebGLRenderer() ) );

return {
dispose: () => janitor.dispose(),
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/scenes/iscriptah/iscriptah.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ const bootup = async () => {
//@ts-expect-error
renderPass.camera = cameras[i];
renderComposer.render( delta, viewports[i] );
renderComposer.renderBuffer();
renderComposer.drawBuffer();
}
controls.update();
};
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3348,10 +3348,10 @@ electron-to-chromium@^1.4.284:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.366.tgz#48d400f9c4af8e80f7bbad0d18730c165d43155e"
integrity sha512-XjC4pyf1no8kJe24nUfyexpWwiGRbZWXU/KbprSEvXcTXUlr3Zr5vK3lQt2to0ttpMhAc3iENccwPSKbnEW2Fg==

electron@^25.2.0:
version "25.2.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-25.2.0.tgz#ff832d88f78481a82cf9feb72e605ec43553d4ba"
integrity sha512-I/rhcW2sV2fyiveVSBr2N7v5ZiCtdGY0UiNCDZgk2fpSC+irQjbeh7JT2b4vWmJ2ogOXBjqesrN9XszTIG6DHg==
electron@26.2.0:
version "26.2.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-26.2.0.tgz#ea1f776c4754fbd387817e3aefc7c88f7171c852"
integrity sha512-H6Z0sYTtLcybHCQT1yti/8BK+vN5/ZfoekKcdrfZMh5mVf2Z7psFVs6nBhXPzIOyRE/gdb6NcOppnUsGc3NJVQ==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^18.11.18"
Expand Down Expand Up @@ -6747,10 +6747,10 @@ postcss@^8.4.18:
picocolors "^1.0.0"
source-map-js "^1.0.2"

postprocessing@6.30.2:
version "6.30.2"
resolved "https://registry.yarnpkg.com/postprocessing/-/postprocessing-6.30.2.tgz#8cfb5561bfce63c983fae5d2cd8efa5bbd04fe6d"
integrity sha512-Vt77s5DkHyUOV4bmk10J46DHJLglBfIo9ARPI0o62UIAx9omANfuPJTKiLVoYlC1ApkV9y3ldBDipF3IldB7YA==
postprocessing@6.32.2:
version "6.32.2"
resolved "https://registry.yarnpkg.com/postprocessing/-/postprocessing-6.32.2.tgz#4b6fe0c821e448986c566379df6c3ecd163995a7"
integrity sha512-BpjIHeElXRmkcqO6p8Pi6W1uDcivQa2FVQ/Swnoo32Cg5bq/bb0mh9hXSHeCkIBD0W4D2KU8Fg7jBICztcN9iQ==

prelude-ls@^1.2.1:
version "1.2.1"
Expand Down

0 comments on commit 1bcb470

Please sign in to comment.