examples/shader: remove the CRT example for license incompatibility

This commit is contained in:
Hajime Hoshi 2022-11-17 22:47:02 +09:00
parent 5cd7d9107e
commit 84dd1679e3
4 changed files with 0 additions and 69 deletions

View File

@ -1,59 +0,0 @@
// Copyright 2022 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build ignore
// +build ignore
package main
var Time float
var Cursor vec2
var ScreenSize vec2
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
const (
BLURSCALEX = 0.45
LOWLUMSCAN = 5.0
HILUMSCAN = 10.0
BRIGHTBOOST = 1.25
MASK_DARK = 0.25
MASK_FADE = 0.8
)
pos := texCoord
origin, size := imageDstRegionOnTexture()
pos -= origin
pos /= size
maskFade := 0.3333 * MASK_FADE
invDims := 1.0 / imageDstTextureSize().xy
p := pos * imageDstTextureSize()
i := floor(p) + 0.50
f := p - i
p = (i + 4.0*f*f*f) * invDims
p.x = mix(p.x, pos.x, BLURSCALEX)
Y := f.y * f.y
YY := Y * Y
whichmask := fract(pos.x * -0.4999)
mask := 1.0
if whichmask < 0.5 {
mask -= MASK_DARK
}
clr := imageSrc2At(p*size + origin).rgb
scanLineWeight := (BRIGHTBOOST - LOWLUMSCAN*(Y-2.05*YY))
scanLineWeightB := 1.0 - HILUMSCAN*(YY-2.8*YY*Y)
return vec4(clr.rgb*mix(scanLineWeight*mask, scanLineWeightB, dot(clr.rgb, vec3(maskFade))), 1.0)
}

View File

@ -1,8 +0,0 @@
// Code generated by file2byteslice. DO NOT EDIT.
//go:build example
// +build example
package main
var crt_go = []byte("// Copyright 2022 The Ebiten Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n//go:build ignore\n// +build ignore\n\npackage main\n\nvar Time float\nvar Cursor vec2\nvar ScreenSize vec2\n\nfunc Fragment(position vec4, texCoord vec2, color vec4) vec4 {\n\tconst (\n\t\tBLURSCALEX = 0.45\n\t\tLOWLUMSCAN = 5.0\n\t\tHILUMSCAN = 10.0\n\t\tBRIGHTBOOST = 1.25\n\t\tMASK_DARK = 0.25\n\t\tMASK_FADE = 0.8\n\t)\n\n\tpos := texCoord\n\torigin, size := imageDstRegionOnTexture()\n\tpos -= origin\n\tpos /= size\n\n\tmaskFade := 0.3333 * MASK_FADE\n\tinvDims := 1.0 / imageDstTextureSize().xy\n\tp := pos * imageDstTextureSize()\n\ti := floor(p) + 0.50\n\tf := p - i\n\tp = (i + 4.0*f*f*f) * invDims\n\tp.x = mix(p.x, pos.x, BLURSCALEX)\n\tY := f.y * f.y\n\tYY := Y * Y\n\twhichmask := fract(pos.x * -0.4999)\n\tmask := 1.0\n\tif whichmask < 0.5 {\n\t\tmask -= MASK_DARK\n\t}\n\n\tclr := imageSrc2At(p*size + origin).rgb\n\tscanLineWeight := (BRIGHTBOOST - LOWLUMSCAN*(Y-2.05*YY))\n\tscanLineWeightB := 1.0 - HILUMSCAN*(YY-2.8*YY*Y)\n\n\treturn vec4(clr.rgb*mix(scanLineWeight*mask, scanLineWeightB, dot(clr.rgb, vec3(maskFade))), 1.0)\n}\n")

View File

@ -24,4 +24,3 @@ package main
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=chromaticaberration.go -output=chromaticaberration_go.go -var=chromaticaberration_go -buildtags=example //go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=chromaticaberration.go -output=chromaticaberration_go.go -var=chromaticaberration_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=dissolve.go -output=dissolve_go.go -var=dissolve_go -buildtags=example //go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=dissolve.go -output=dissolve_go.go -var=dissolve_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=water.go -output=water_go.go -var=water_go -buildtags=example //go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=water.go -output=water_go.go -var=water_go -buildtags=example
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice -package=main -input=crt.go -output=crt_go.go -var=crt_go -buildtags=example

View File

@ -85,7 +85,6 @@ var shaderSrcs = [][]byte{
chromaticaberration_go, chromaticaberration_go,
dissolve_go, dissolve_go,
water_go, water_go,
crt_go,
} }
type Game struct { type Game struct {