Skip to content

Commit

Permalink
Kill of brfs for NPM release.
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyHairy committed Jan 8, 2018
1 parent fff4aae commit aa2da05
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 231 deletions.
52 changes: 23 additions & 29 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = function(grunt) {

browserify: {
options: {
configure: b => b.plugin('tsify', { project: __dirname }).transform('brfs'),
configure: b => b.plugin('tsify', { project: __dirname }),
browserifyOptions: {
debug: true
}
Expand Down Expand Up @@ -149,14 +149,14 @@ module.exports = function(grunt) {
},
stellerator_worker: {
options: {
configure: b => b.plugin('tsify', { project: path.join(__dirname, 'worker') }).transform('brfs')
configure: b => b.plugin('tsify', { project: path.join(__dirname, 'worker') })
},
dest: 'web/js/compiled/worker/stellerator_worker.js',
src: ['worker/src/main/stellerator.ts']
},
video_pipeline_worker: {
options: {
configure: b => b.plugin('tsify', { project: path.join(__dirname, 'worker') }).transform('brfs')
configure: b => b.plugin('tsify', { project: path.join(__dirname, 'worker') })
},
dest: 'web/js/compiled/worker/video_pipeline_worker.js',
src: ['worker/src/main/video-pipeline.ts']
Expand All @@ -166,19 +166,16 @@ module.exports = function(grunt) {
src: ['src/web/stella/stellerator/main.tsx'],
options: {
configure: b =>
b
.plugin('tsify', { project: __dirname })
.transform(
envify({
NODE_ENV: 'development',
STELLERATOR_WORKER_URL: 'js/compiled/worker/stellerator_worker.js',
VIDEO_PIPELINE_WORKER_URL: 'js/compiled/worker/video_pipeline_worker.js',
HELPPAGE_URL: 'doc/stellerator.md',
BUILD_ID: buildId
}),
{ global: true }
)
.transform('brfs'),
b.plugin('tsify', { project: __dirname }).transform(
envify({
NODE_ENV: 'development',
STELLERATOR_WORKER_URL: 'js/compiled/worker/stellerator_worker.js',
VIDEO_PIPELINE_WORKER_URL: 'js/compiled/worker/video_pipeline_worker.js',
HELPPAGE_URL: 'doc/stellerator.md',
BUILD_ID: buildId
}),
{ global: true }
),
browserifyOptions: {
debug: true
}
Expand All @@ -189,19 +186,16 @@ module.exports = function(grunt) {
src: ['src/web/stella/stellerator/main.tsx'],
options: {
configure: b =>
b
.plugin('tsify', { project: __dirname })
.transform(
envify({
NODE_ENV: 'production',
STELLERATOR_WORKER_URL: 'js/worker/stellerator_worker.min.js',
VIDEO_PIPELINE_WORKER_URL: 'js/worker/video_pipeline_worker.min.js',
HELPPAGE_URL: 'doc/stellerator.md',
BUILD_ID: buildId
}),
{ global: true }
)
.transform('brfs'),
b.plugin('tsify', { project: __dirname }).transform(
envify({
NODE_ENV: 'production',
STELLERATOR_WORKER_URL: 'js/worker/stellerator_worker.min.js',
VIDEO_PIPELINE_WORKER_URL: 'js/worker/video_pipeline_worker.min.js',
HELPPAGE_URL: 'doc/stellerator.md',
BUILD_ID: buildId
}),
{ global: true }
),
browserifyOptions: {
debug: true
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "A 6502 emulator written in typescript",
"author": "[email protected]",
"license": "GPL-2.0+",
"files": ["lib"],
"files": [
"lib"
],
"keywords": [
"emulation",
"6502",
Expand Down Expand Up @@ -44,7 +46,6 @@
"@types/react-router-redux": "^5.0.8",
"@types/screenfull": "^3.3.1",
"@types/seedrandom": "~2.4.27",
"brfs": "~1.4.3",
"classnames": "^2.2.5",
"commonmark": "^0.28.1",
"cssnano": "~3.10.0",
Expand Down
12 changes: 6 additions & 6 deletions src/web/driver/webgl/WebglVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

import * as fs from 'fs';

import PoolMemberInterface from '../../../tools/pool/PoolMemberInterface';
import VideoEndpointInterface from '../VideoEndpointInterface';
import VideoDriverInterface from '../VideoDriverInterface';

const fragmentShaderPovSource = fs.readFileSync(__dirname + '/shader/render_pov.fsh', 'utf-8');
const fragmentSahderPlainSource = fs.readFileSync(__dirname + '/shader/render_plain.fsh', 'utf-8');
const vertexShaderSource = fs.readFileSync(__dirname + '/shader/render.vsh', 'utf-8');
import {
vertexShader as vertexShaderSource,
fragmentShaderPlain as fragmentShaderPlainSource,
fragmentShaderPov as fragmentShaderPovSource
} from './shader';

const CONTEXT_IDS = ['webgl', 'experimental-webgl'];

Expand Down Expand Up @@ -330,7 +330,7 @@ class WebglVideoDriver implements VideoDriverInterface {
throw new Error(`failed to compile vertex shader: ${gl.getShaderInfoLog(vertexShader)}`);
}

gl.shaderSource(fragmentShader, this._povEmulation ? fragmentShaderPovSource : fragmentSahderPlainSource);
gl.shaderSource(fragmentShader, this._povEmulation ? fragmentShaderPovSource : fragmentShaderPlainSource);
gl.compileShader(fragmentShader);

if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
Expand Down
44 changes: 44 additions & 0 deletions src/web/driver/webgl/shader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export const vertexShader = `
attribute vec2 a_VertexPosition;
attribute vec2 a_TextureCoordinate;
varying vec2 v_TextureCoordinate;
void main() {
v_TextureCoordinate = a_TextureCoordinate;
gl_Position = vec4(a_VertexPosition, 0, 1);
}
`;

export const fragmentShaderPlain = `
precision mediump float;
varying vec2 v_TextureCoordinate;
uniform sampler2D u_Sampler0;
uniform float u_Gamma;
void main() {
vec4 texel = texture2D(u_Sampler0, v_TextureCoordinate);
gl_FragColor = vec4(pow(texel.rgb, vec3(u_Gamma)), 1.);
}
`;

export const fragmentShaderPov = `
precision mediump float;
varying vec2 v_TextureCoordinate;
uniform sampler2D u_Sampler0, u_Sampler1, u_Sampler2;
uniform float u_Gamma;
void main() {
vec4 compositedTexel =
0.4 * texture2D(u_Sampler0, v_TextureCoordinate) +
0.4 * texture2D(u_Sampler1, v_TextureCoordinate) +
0.2 * texture2D(u_Sampler2, v_TextureCoordinate);
gl_FragColor = vec4(pow(compositedTexel.rgb, vec3(u_Gamma)), 1.);
}
`;
9 changes: 0 additions & 9 deletions src/web/driver/webgl/shader/render.vsh

This file was deleted.

12 changes: 0 additions & 12 deletions src/web/driver/webgl/shader/render_plain.fsh

This file was deleted.

15 changes: 0 additions & 15 deletions src/web/driver/webgl/shader/render_pov.fsh

This file was deleted.

Loading

0 comments on commit aa2da05

Please sign in to comment.