port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

22
ev14-4k/4klang.h Normal file
View File

@@ -0,0 +1,22 @@
// some useful song defines for 4klang
#define SAMPLE_RATE 44100
#define BPM 175.000000
#define MAX_INSTRUMENTS 10
#define MAX_PATTERNS 131
#define PATTERN_SIZE_SHIFT 4
#define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
#define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
#define SAMPLES_PER_TICK 3780
#define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
#define POLYPHONY 2
#define FLOAT_32BIT
#define SAMPLE_TYPE float
#define WINDOWS_OBJECT
// declaration of the external synth render function, you'll always need that
extern "C" void __stdcall _4klang_render(void*);
// declaration of the external envelope buffer. access only if you're song was exported with that option
extern "C" float _4klang_envelope_buffer;
// declaration of the external note buffer. access only if you're song was exported with that option
extern "C" int _4klang_note_buffer;

923
ev14-4k/4klang.inc Normal file
View File

@@ -0,0 +1,923 @@
%macro export_func 1
global _%1
_%1:
%endmacro
%define USE_SECTIONS
%define SAMPLE_RATE 44100
%define MAX_INSTRUMENTS 10
%define MAX_VOICES 2
%define HLD 1
%define BPM 175.000000
%define MAX_PATTERNS 131
%define PATTERN_SIZE_SHIFT 4
%define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
%define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
%define SAMPLES_PER_TICK 3780
%define DEF_LFO_NORMALIZE 0.0000661376
%define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
;%define GO4K_USE_16BIT_OUTPUT
;%define GO4K_USE_GROOVE_PATTERN
;%define GO4K_USE_ENVELOPE_RECORDINGS
;%define GO4K_USE_NOTE_RECORDINGS
%define GO4K_CLIP_OUTPUT
%define GO4K_USE_DST
%define GO4K_USE_DLL
%define GO4K_USE_PAN
%define GO4K_USE_GLOBAL_DLL
%define GO4K_USE_FSTG
%define GO4K_USE_ENV_CHECK
%define GO4K_USE_ENV_MOD_GM
%define GO4K_USE_VCO_CHECK
%define GO4K_USE_VCO_PHASE_OFFSET
%define GO4K_USE_VCO_SHAPE
%define GO4K_USE_VCO_GATE
%define GO4K_USE_VCO_MOD_FM
%define GO4K_USE_VCO_MOD_TM
%define GO4K_USE_VCO_MOD_GM
%define GO4K_USE_VCO_MOD_SM
%define GO4K_USE_VCF_CHECK
%define GO4K_USE_VCF_MOD_FM
%define GO4K_USE_VCF_HIGH
%define GO4K_USE_VCF_BAND
%define GO4K_USE_VCF_PEAK
%define GO4K_USE_DST_CHECK
%define GO4K_USE_DST_SH
%define GO4K_USE_DLL_CHORUS_CLAMP
%define GO4K_USE_DLL_DAMP
%define GO4K_USE_DLL_DC_FILTER
%define GO4K_USE_FSTG_CHECK
%define GO4K_USE_OUT_MOD_GM
%define GO4K_USE_WAVESHAPER_CLIP
%define MAX_DELAY 65536
%define MAX_WORKSPACE_SLOTS 8
%define GO4K_BEGIN_CMDDEF(def_name)
%define GO4K_END_CMDDEF db 0
%define GO4K_BEGIN_PARAMDEF(def_name)
%define GO4K_END_PARAMDEF
GO4K_ENV_ID equ 1
%macro GO4K_ENV 5
db %1
db %2
db %3
db %4
db %5
%endmacro
%define ATTAC(val) val
%define DECAY(val) val
%define SUSTAIN(val) val
%define RELEASE(val) val
%define GAIN(val) val
struc go4kENV_val
.attac resd 1
.decay resd 1
.sustain resd 1
.release resd 1
.gain resd 1
.size
endstruc
struc go4kENV_wrk
.state resd 1
.level resd 1
.gm resd 1
.am resd 1
.dm resd 1
.sm resd 1
.rm resd 1
.size
endstruc
%define ENV_STATE_ATTAC 0
%define ENV_STATE_DECAY 1
%define ENV_STATE_SUSTAIN 2
%define ENV_STATE_RELEASE 3
%define ENV_STATE_OFF 4
GO4K_VCO_ID equ 2
%macro GO4K_VCO 8
db %1
db %2
%ifdef GO4K_USE_VCO_PHASE_OFFSET
db %3
%endif
%ifdef GO4K_USE_VCO_GATE
db %4
%endif
db %5
%ifdef GO4K_USE_VCO_SHAPE
db %6
%endif
db %7
db %8
%endmacro
%define TRANSPOSE(val) val
%define DETUNE(val) val
%define PHASE(val) val
%define GATES(val) val
%define COLOR(val) val
%define SHAPE(val) val
%define FLAGS(val) val
%define SINE 0x01
%define TRISAW 0x02
%define PULSE 0x04
%define NOISE 0x08
%define LFO 0x10
%define GATE 0x20
struc go4kVCO_val
.transpose resd 1
.detune resd 1
%ifdef GO4K_USE_VCO_PHASE_OFFSET
.phaseofs resd 1
%endif
%ifdef GO4K_USE_VCO_GATE
.gate resd 1
%endif
.color resd 1
%ifdef GO4K_USE_VCO_SHAPE
.shape resd 1
%endif
.gain resd 1
.flags resd 1
.size
endstruc
struc go4kVCO_wrk
.phase resd 1
.tm resd 1
.dm resd 1
.fm resd 1
.pm resd 1
.cm resd 1
.sm resd 1
.gm resd 1
.size
endstruc
GO4K_VCF_ID equ 3
%macro GO4K_VCF 3
db %1
db %2
db %3
%endmacro
%define LOWPASS 0x1
%define HIGHPASS 0x2
%define BANDPASS 0x4
%define BANDSTOP 0x3
%define ALLPASS 0x7
%define PEAK 0x8
%define FREQUENCY(val) val
%define RESONANCE(val) val
%define VCFTYPE(val) val
struc go4kVCF_val
.freq resd 1
.res resd 1
.type resd 1
.size
endstruc
struc go4kVCF_wrk
.low resd 1
.high resd 1
.band resd 1
.freq resd 1
.fm resd 1
.rm resd 1
.size
endstruc
GO4K_DST_ID equ 4
%macro GO4K_DST 2
db %1
%ifdef GO4K_USE_DST_SH
db %2
%endif
%endmacro
%define DRIVE(val) val
%define SNHFREQ(val) val
struc go4kDST_val
.drive resd 1
%ifdef GO4K_USE_DST_SH
.snhfreq resd 1
%endif
.size
endstruc
struc go4kDST_wrk
%ifdef GO4K_USE_DST_SH
.out resd 1
.snhphase resd 1
%endif
.dm resd 1
.sm resd 1
.size
endstruc
GO4K_DLL_ID equ 5
%macro GO4K_DLL 8
db %1
db %2
db %3
%ifdef GO4K_USE_DLL_DAMP
db %4
%endif
%ifdef GO4K_USE_DLL_CHORUS
db %5
db %6
%endif
db %7
db %8
%endmacro
%define PREGAIN(val) val
%define DRY(val) val
%define FEEDBACK(val) val
%define DEPTH(val) val
%define DAMP(val) val
%define DELAY(val) val
%define COUNT(val) val
struc go4kDLL_val
.pregain resd 1
.dry resd 1
.feedback resd 1
%ifdef GO4K_USE_DLL_DAMP
.damp resd 1
%endif
%ifdef GO4K_USE_DLL_CHORUS
.freq resd 1
.depth
%endif
.delay resd 1
.count resd 1
.size
endstruc
struc go4kDLL_wrk
.index resd 1
.store resd 1
.dcin resd 1
.dcout resd 1
%ifdef GO4K_USE_DLL_CHORUS
.phase resd 1
%endif
.buffer resd MAX_DELAY
.size
endstruc
struc go4kDLL_wrk2
.pm resd 1
.fm resd 1
.im resd 1
.dm resd 1
.sm resd 1
.am resd 1
.size
endstruc
GO4K_FOP_ID equ 6
%macro GO4K_FOP 1
db %1
%endmacro
%define OP(val) val
%define FOP_POP 0x1
%define FOP_ADDP 0x2
%define FOP_MULP 0x3
%define FOP_PUSH 0x4
%define FOP_XCH 0x5
%define FOP_ADD 0x6
%define FOP_MUL 0x7
%define FOP_ADDP2 0x8
%define FOP_LOADNOTE 0x9
struc go4kFOP_val
.flags resd 1
.size
endstruc
struc go4kFOP_wrk
.size
endstruc
GO4K_FST_ID equ 7
%macro GO4K_FST 2
db %1
db %2
%endmacro
%define AMOUNT(val) val
%define DEST(val) val
struc go4kFST_val
.amount resd 1
.op1 resd 1
.size
endstruc
struc go4kFST_wrk
.size
endstruc
GO4K_PAN_ID equ 8
%macro GO4K_PAN 1
%ifdef GO4K_USE_PAN
db %1
%endif
%endmacro
%define PANNING(val) val
struc go4kPAN_val
%ifdef GO4K_USE_PAN
.panning resd 1
%endif
.size
endstruc
struc go4kPAN_wrk
.pm resd 1
.size
endstruc
GO4K_OUT_ID equ 9
%macro GO4K_OUT 2
db %1
%ifdef GO4K_USE_GLOBAL_DLL
db %2
%endif
%endmacro
%define AUXSEND(val) val
struc go4kOUT_val
.gain resd 1
%ifdef GO4K_USE_GLOBAL_DLL
.auxsend resd 1
%endif
.size
endstruc
struc go4kOUT_wrk
.am resd 1
.gm resd 1
.size
endstruc
GO4K_ACC_ID equ 10
%macro GO4K_ACC 1
db %1
%endmacro
%define OUTPUT 0
%define AUX 8
%define ACCTYPE(val) val
struc go4kACC_val
.acctype resd 1
.size
endstruc
struc go4kACC_wrk
.size
endstruc
%ifdef GO4K_USE_FLD
GO4K_FLD_ID equ 11
%macro GO4K_FLD 1
db
%endmacro
%define VALUE(val) val
struc go4kFLD_val
.value resd 1
.size
endstruc
struc go4kFLD_wrk
.vm resd 1
.size
endstruc
%endif
%ifdef GO4K_USE_FSTG
GO4K_FSTG_ID equ 12
%macro GO4K_FSTG 2
db %1
dd %2
%endmacro
struc go4kFSTG_val
.amount resd 1
.op1 resd 1
.size
endstruc
struc go4kFSTG_wrk
.size
endstruc
%endif
struc go4k_instrument
.release resd 1
.note resd 1
.workspace resd 256
.dlloutl resd 1
.dlloutr resd 1
.outl resd 1
.outr resd 1
.size
endstruc
struc go4k_synth
.instruments resb go4k_instrument.size * MAX_INSTRUMENTS * MAX_VOICES
.global resb go4k_instrument.size * MAX_VOICES
.size
endstruc
%ifdef USE_SECTIONS
section .g4kmuc1 data align=1
%else
section .data align=1
%endif
go4k_patterns
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 0, 0, 0, 0, 0, 0, 84, HLD, HLD, HLD, HLD, HLD, 76, HLD, HLD, HLD,
db 77, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 64, HLD, 69, HLD,
db 81, HLD, 93, HLD, HLD, HLD, 84, HLD, HLD, HLD, HLD, HLD, 76, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 64, HLD, 69, HLD,
db 77, HLD, 76, HLD, 77, HLD, 74, HLD, HLD, HLD, 77, HLD, 81, HLD, HLD, HLD,
db 74, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 88, HLD, 89, HLD, HLD, HLD,
db 86, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 79, HLD, 78, HLD, 79, HLD, 76, HLD, HLD, HLD, 79, HLD, 83, HLD, HLD, HLD,
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 90, HLD, 91, HLD, HLD, HLD,
db 88, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 84, HLD, 83, HLD, 84, HLD, 81, HLD, HLD, HLD, 84, HLD, 88, HLD, HLD, HLD,
db 81, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 95, HLD, 96, HLD, HLD, HLD,
db 93, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 81, HLD, 79, HLD, 81, HLD, 78, HLD, HLD, HLD, 81, HLD, 84, HLD, HLD, HLD,
db 78, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 91, HLD, 93, HLD, HLD, HLD,
db 90, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 90, HLD, 91, HLD, 69, HLD,
db 0, 0, 78, HLD, 79, HLD, 76, HLD, HLD, HLD, 79, HLD, 83, HLD, HLD, HLD,
db 88, HLD, 86, HLD, 88, HLD, 84, HLD, HLD, HLD, 88, HLD, 91, HLD, HLD, HLD,
db 84, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 98, HLD, 100, HLD, HLD, HLD,
db 96, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 83, HLD, 81, HLD, 83, HLD, 79, HLD, HLD, HLD, 83, HLD, 86, HLD, HLD, HLD,
db 79, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 93, HLD, 95, HLD, HLD, HLD,
db 91, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 76, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0,
db 57, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 62, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 64, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 59, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 60, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 48, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 67, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 55, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 66, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 69, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 71, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 83, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 75, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 72, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 84, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 87, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, HLD, HLD, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 60, HLD, 60, HLD, HLD, HLD, 60, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, 60, HLD, 60, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 60, HLD, 60, HLD, HLD, HLD, 60, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, HLD, HLD, HLD,
db 60, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 60, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 60, HLD, HLD, HLD,
db 50, HLD, HLD, HLD, 38, HLD, HLD, HLD, 38, HLD, HLD, HLD, 50, HLD, HLD, HLD,
db 38, HLD, HLD, HLD, 38, HLD, HLD, HLD, 50, HLD, 62, HLD, 50, HLD, HLD, HLD,
db 38, HLD, HLD, HLD, 50, HLD, HLD, HLD, 50, HLD, HLD, HLD, 38, HLD, HLD, HLD,
db 38, HLD, HLD, HLD, 50, HLD, HLD, HLD, 62, HLD, 50, HLD, 38, HLD, HLD, HLD,
db 52, HLD, HLD, HLD, 40, HLD, HLD, HLD, 40, HLD, HLD, HLD, 52, HLD, HLD, HLD,
db 40, HLD, HLD, HLD, 40, HLD, HLD, HLD, 52, HLD, 64, HLD, 52, HLD, HLD, HLD,
db 40, HLD, HLD, HLD, 52, HLD, HLD, HLD, 52, HLD, HLD, HLD, 40, HLD, HLD, HLD,
db 40, HLD, HLD, HLD, 52, HLD, HLD, HLD, 64, HLD, 52, HLD, 40, HLD, HLD, HLD,
db 57, HLD, HLD, HLD, 45, HLD, HLD, HLD, 45, HLD, HLD, HLD, 57, HLD, HLD, HLD,
db 45, HLD, HLD, HLD, 45, HLD, HLD, HLD, 57, HLD, 69, HLD, 57, HLD, HLD, HLD,
db 45, HLD, HLD, HLD, 57, HLD, HLD, HLD, 57, HLD, HLD, HLD, 45, HLD, HLD, HLD,
db 45, HLD, HLD, HLD, 57, HLD, HLD, HLD, 69, HLD, 57, HLD, 45, HLD, HLD, HLD,
db 59, HLD, HLD, HLD, 47, HLD, HLD, HLD, 47, HLD, HLD, HLD, 59, HLD, HLD, HLD,
db 47, HLD, HLD, HLD, 47, HLD, HLD, HLD, 59, HLD, 71, HLD, 59, HLD, HLD, HLD,
db 47, HLD, HLD, HLD, 59, HLD, HLD, HLD, 59, HLD, HLD, HLD, 47, HLD, HLD, HLD,
db 47, HLD, HLD, HLD, 59, HLD, HLD, HLD, 71, HLD, 59, HLD, 47, HLD, HLD, HLD,
db 40, HLD, HLD, HLD, 40, HLD, HLD, HLD, 52, HLD, 40, HLD, 52, HLD, HLD, HLD,
db 40, HLD, HLD, HLD, 52, HLD, HLD, HLD, 40, HLD, 52, HLD, 40, HLD, HLD, HLD,
db 48, HLD, HLD, HLD, 36, HLD, HLD, HLD, 36, HLD, HLD, HLD, 48, HLD, HLD, HLD,
db 36, HLD, HLD, HLD, 36, HLD, HLD, HLD, 48, HLD, 60, HLD, 48, HLD, HLD, HLD,
db 48, HLD, HLD, HLD, 60, HLD, HLD, HLD, 60, HLD, HLD, HLD, 48, HLD, HLD, HLD,
db 48, HLD, HLD, HLD, 60, HLD, HLD, HLD, 72, HLD, 60, HLD, 48, HLD, HLD, HLD,
db 55, HLD, HLD, HLD, 43, HLD, HLD, HLD, 43, HLD, HLD, HLD, 55, HLD, HLD, HLD,
db 43, HLD, HLD, HLD, 43, HLD, HLD, HLD, 55, HLD, 67, HLD, 55, HLD, HLD, HLD,
db 43, HLD, HLD, HLD, 55, HLD, HLD, HLD, 55, HLD, HLD, HLD, 43, HLD, HLD, HLD,
db 43, HLD, HLD, HLD, 55, HLD, HLD, HLD, 67, HLD, 55, HLD, 43, HLD, HLD, HLD,
db 40, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0,
db 81, 2, 83, 2, 84, 2, 86, 2, 2, HLD, 88, HLD, HLD, HLD, HLD, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 84, HLD, HLD, HLD, 2, HLD, HLD, HLD,
db 83, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 79, 2, 81, 2,
db 76, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 79, 2, 81, HLD, HLD, HLD, 83, HLD, 2, HLD, 79, HLD, 2, HLD, HLD, HLD,
db 78, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 2, HLD, HLD, HLD, 79, 2, 81, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 81, 2, 83, 2, 84, 2, 81, 2,
db 83, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0,
db 81, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 52, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0,
db 2, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 0, 0, 0, 0, 0, 0, 0, 0, 91, 2, 90, 2, 88, 2, 86, 2,
db 88, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 90, 2,
db 88, 2, 90, HLD, 2, HLD, 91, HLD, 2, HLD, 88, HLD, 2, HLD, HLD, HLD,
db 86, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 81, 2,
db 79, 2, 81, HLD, 2, HLD, 83, HLD, 2, HLD, 91, HLD, 2, HLD, HLD, HLD,
db 90, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 91, 2,
db 0, 0, 0, 0, 0, 0, 0, 0, 90, HLD, HLD, HLD, 0, 0, 0, 0,
db 91, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 90, 2,
db 90, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 88, 2,
db 0, 0, 0, 0, 0, 0, 0, 0, 83, HLD, HLD, HLD, 0, 0, 0, 0,
go4k_patterns_end
%ifdef USE_SECTIONS
section .g4kmuc2 data align=1
%else
section .data
%endif
go4k_pattern_lists
Instrument0List db 1, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 7, 8, 9, 8, 10, 5, 6, 5, 7, 8, 9, 8, 10, 11, 12, 11, 13, 8, 9, 8, 10, 14, 15, 14, 16, 8, 9, 8, 10, 11, 12, 11, 13, 8, 9, 8, 10, 14, 15, 14, 16, 8, 9, 8, 10, 8, 17, 8, 10, 8, 17, 8, 10, 8, 17, 8, 10, 8, 17, 18, 10, 19, 20, 19, 21, 22, 23, 22, 24, 14, 15, 14, 16, 8, 9, 8, 10, 19, 20, 19, 21, 22, 23, 22, 24, 14, 15, 14, 16, 8, 9, 8, 10, 8, 9, 8, 10, 8, 9, 8, 10, 8, 25, 26,
Instrument1List db 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 28, 28, 28, 30, 28, 28, 28, 29, 28, 28, 28, 30, 28, 28, 28, 27, 28, 28, 28, 30, 28, 28, 28, 31, 28, 28, 28, 30, 28, 28, 28, 27, 28, 28, 28, 30, 28, 28, 28, 31, 28, 28, 28, 30, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 32, 28, 33, 32, 34, 28, 34, 35, 31, 28, 36, 31, 30, 28, 34, 35, 32, 28, 33, 32, 34, 28, 34, 35, 31, 28, 36, 31, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
Instrument2List db 25, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 28, 28, 28, 38, 28, 28, 28, 37, 28, 28, 28, 38, 28, 28, 28, 25, 28, 28, 28, 39, 28, 28, 28, 40, 28, 28, 28, 39, 28, 28, 28, 25, 28, 28, 28, 39, 28, 28, 28, 40, 28, 28, 28, 39, 28, 28, 28, 38, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 41, 42, 28, 28, 39, 28, 28, 28, 40, 28, 28, 28, 39, 28, 28, 28, 41, 42, 28, 28, 39, 28, 28, 28, 40, 43, 28, 28, 39, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
Instrument3List db 0, 0, 0, 0, 0, 0, 41, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Instrument4List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
Instrument5List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 51, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 32, 49, 32, 50, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
Instrument6List db 32, 28, 28, 28, 28, 28, 0, 48, 28, 28, 28, 28, 28, 28, 0, 48, 28, 28, 28, 28, 28, 28, 0, 48, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 32, 28, 28, 28, 28, 28, 0, 0, 32, 28, 28, 28, 28, 28, 0, 48, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0,
Instrument7List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 56, 57, 58, 59, 64, 65, 66, 67, 56, 57, 58, 59, 60, 61, 62, 63, 56, 57, 58, 59, 64, 65, 66, 67, 56, 57, 58, 59, 56, 68, 58, 69, 56, 68, 58, 69, 56, 68, 58, 69, 56, 68, 58, 69, 70, 71, 72, 73, 74, 75, 76, 77, 64, 65, 66, 67, 56, 57, 76, 77, 70, 71, 72, 73, 74, 75, 76, 77, 64, 65, 66, 67, 56, 57, 58, 59, 56, 57, 58, 59, 56, 57, 58, 59, 56, 57, 78,
Instrument8List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 28, 28, 28, 28, 28, 28, 28, 33, 28, 28, 28, 28, 28, 28, 28, 33, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 33, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Instrument9List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 80, 81, 82, 0, 83, 84, 85, 0, 86, 87, 82, 0, 83, 88, 79, 0, 80, 81, 82, 0, 83, 84, 85, 0, 86, 87, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 89, 89, 89, 89, 89, 90, 91, 92, 24, 0, 93, 94, 39, 0, 95, 96, 13, 0, 97, 98, 10, 0, 91, 92, 24, 0, 93, 94, 39, 0, 95, 99, 43, 0, 100, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
go4k_pattern_lists_end
%ifdef USE_SECTIONS
section .g4kmuc3 data align=1
%else
section .data
%endif
go4k_synth_instructions
GO4K_BEGIN_CMDDEF(Instrument0)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_DLL_ID
db GO4K_PAN_ID
db GO4K_DLL_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument1)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_DST_ID
db GO4K_VCF_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument2)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCF_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_DST_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_DLL_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument3)
db GO4K_ENV_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FOP_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument4)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument5)
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_ENV_ID
db GO4K_DST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument6)
db GO4K_ENV_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FOP_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument7)
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_DST_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument8)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument9)
db GO4K_ENV_ID
db GO4K_ENV_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_DST_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_DLL_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Global)
db GO4K_ACC_ID
db GO4K_VCF_ID
db GO4K_DLL_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_DLL_ID
db GO4K_ACC_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FSTG_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
go4k_synth_instructions_end
%ifdef USE_SECTIONS
section .g4kmuc4 data align=1
%else
section .data
%endif
go4k_synth_parameter_values
GO4K_BEGIN_PARAMDEF(Instrument0)
GO4K_ENV ATTAC(16),DECAY(68),SUSTAIN(0),RELEASE(32),GAIN(72)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(64),GATES(0),COLOR(32),SHAPE(96),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_DLL PREGAIN(64),DRY(96),FEEDBACK(16),DAMP(64),FREQUENCY(64),DEPTH(0),DELAY(16),COUNT(1)
GO4K_PAN PANNING(0)
GO4K_DLL PREGAIN(128),DRY(64),FEEDBACK(0),DAMP(128),FREQUENCY(0),DEPTH(128),DELAY(17),COUNT(1)
GO4K_OUT GAIN(64), AUXSEND(48)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument1)
GO4K_ENV ATTAC(64),DECAY(64),SUSTAIN(64),RELEASE(64),GAIN(128)
GO4K_VCO TRANSPOSE(52),DETUNE(60),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(8),FLAGS(SINE)
GO4K_FST AMOUNT(68),DEST(4*MAX_WORKSPACE_SLOTS+3)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(48),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(96),GAIN(128),FLAGS(TRISAW|LFO)
GO4K_DST DRIVE(112), SNHFREQ(64)
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(LOWPASS)
GO4K_VCO TRANSPOSE(52),DETUNE(68),PHASE(64),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(8),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_PAN PANNING(40)
GO4K_OUT GAIN(48), AUXSEND(24)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument2)
GO4K_ENV ATTAC(80),DECAY(64),SUSTAIN(64),RELEASE(72),GAIN(128)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(24),FLAGS(NOISE)
GO4K_VCF FREQUENCY(2),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_FST AMOUNT(65),DEST(7*MAX_WORKSPACE_SLOTS+3)
GO4K_FST AMOUNT(63),DEST(6*MAX_WORKSPACE_SLOTS+3)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(64),DETUNE(60),PHASE(0),GATES(0),COLOR(32),SHAPE(112),GAIN(24),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(52),DETUNE(62),PHASE(32),GATES(0),COLOR(80),SHAPE(40),GAIN(48),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(60),DETUNE(68),PHASE(64),GATES(0),COLOR(48),SHAPE(88),GAIN(32),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(48),DETUNE(66),PHASE(96),GATES(0),COLOR(96),SHAPE(16),GAIN(32),FLAGS(TRISAW)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_VCF FREQUENCY(64),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_DST DRIVE(64), SNHFREQ(96)
GO4K_VCF FREQUENCY(72),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_VCF FREQUENCY(8),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_DLL PREGAIN(64),DRY(64),FEEDBACK(64),DAMP(64),FREQUENCY(0),DEPTH(0),DELAY(18),COUNT(1)
GO4K_PAN PANNING(96)
GO4K_OUT GAIN(16), AUXSEND(32)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument3)
GO4K_ENV ATTAC(112),DECAY(128),SUSTAIN(128),RELEASE(112),GAIN(128)
GO4K_FSTG AMOUNT(100),DEST(0*go4k_instrument.size*MAX_VOICES+3*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(100),DEST(1*go4k_instrument.size*MAX_VOICES+11*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(100),DEST(2*go4k_instrument.size*MAX_VOICES+18*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(80),DEST(9*go4k_instrument.size*MAX_VOICES+23*MAX_WORKSPACE_SLOTS*4+1*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(80),DEST(8*go4k_instrument.size*MAX_VOICES+2*MAX_WORKSPACE_SLOTS*4+7*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(112),DEST(7*go4k_instrument.size*MAX_VOICES+13*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(88),DEST(7*go4k_instrument.size*MAX_VOICES+15*MAX_WORKSPACE_SLOTS*4+1*4+go4k_instrument.workspace)
GO4K_FOP OP(FOP_POP)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument4)
GO4K_ENV ATTAC(0),DECAY(70),SUSTAIN(0),RELEASE(0),GAIN(128)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(NOISE)
GO4K_VCF FREQUENCY(24),RESONANCE(128),VCFTYPE(BANDPASS)
GO4K_FOP OP(FOP_MULP)
GO4K_ENV ATTAC(0),DECAY(48),SUSTAIN(0),RELEASE(64),GAIN(96)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(24),FLAGS(NOISE)
GO4K_VCF FREQUENCY(96),RESONANCE(128),VCFTYPE(BANDSTOP)
GO4K_FOP OP(FOP_MULP)
GO4K_ENV ATTAC(0),DECAY(72),SUSTAIN(64),RELEASE(64),GAIN(16)
GO4K_FST AMOUNT(66),DEST(12*MAX_WORKSPACE_SLOTS+3)
GO4K_FOP OP(FOP_POP)
GO4K_ENV ATTAC(0),DECAY(68),SUSTAIN(0),RELEASE(64),GAIN(128)
GO4K_VCO TRANSPOSE(0),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(32),FLAGS(SINE|LFO)
GO4K_FOP OP(FOP_MULP)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_PUSH)
GO4K_FOP OP(FOP_ADDP)
GO4K_PAN PANNING(56)
GO4K_OUT GAIN(64), AUXSEND(48)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument5)
GO4K_ENV ATTAC(0),DECAY(76),SUSTAIN(0),RELEASE(64),GAIN(128)
GO4K_FST AMOUNT(96),DEST(0*MAX_WORKSPACE_SLOTS+2)
GO4K_ENV ATTAC(0),DECAY(72),SUSTAIN(0),RELEASE(0),GAIN(128)
GO4K_DST DRIVE(32), SNHFREQ(128)
GO4K_FST AMOUNT(80),DEST(6*MAX_WORKSPACE_SLOTS+1)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(40),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_MULP)
GO4K_PAN PANNING(64)
GO4K_OUT GAIN(64), AUXSEND(8)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument6)
GO4K_ENV ATTAC(90),DECAY(128),SUSTAIN(128),RELEASE(90),GAIN(128)
GO4K_FSTG AMOUNT(112),DEST(1*go4k_instrument.size*MAX_VOICES+10*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(112),DEST(2*go4k_instrument.size*MAX_VOICES+17*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FOP OP(FOP_POP)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument7)
GO4K_ENV ATTAC(32),DECAY(72),SUSTAIN(0),RELEASE(32),GAIN(88)
GO4K_FST AMOUNT(108),DEST(0*MAX_WORKSPACE_SLOTS+2)
GO4K_FST AMOUNT(88),DEST(11*MAX_WORKSPACE_SLOTS+4)
GO4K_ENV ATTAC(0),DECAY(60),SUSTAIN(0),RELEASE(0),GAIN(128)
GO4K_FST AMOUNT(52),DEST(7*MAX_WORKSPACE_SLOTS+6)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(64),DETUNE(70),PHASE(32),GATES(85),COLOR(64),SHAPE(80),GAIN(64),FLAGS(SINE)
GO4K_VCO TRANSPOSE(64),DETUNE(48),PHASE(48),GATES(85),COLOR(64),SHAPE(96),GAIN(64),FLAGS(SINE)
GO4K_FOP OP(FOP_ADDP)
GO4K_VCF FREQUENCY(32),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_DST DRIVE(112), SNHFREQ(128)
GO4K_VCF FREQUENCY(32),RESONANCE(128),VCFTYPE(ALLPASS)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(24),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_PAN PANNING(48)
GO4K_OUT GAIN(8), AUXSEND(8)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument8)
GO4K_ENV ATTAC(0),DECAY(128),SUSTAIN(128),RELEASE(0),GAIN(128)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(1),COLOR(3),SHAPE(64),GAIN(128),FLAGS(GATE|LFO)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(32),FLAGS(NOISE)
GO4K_VCF FREQUENCY(112),RESONANCE(128),VCFTYPE(BANDPASS)
GO4K_VCF FREQUENCY(112),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_FOP OP(FOP_MULP)
GO4K_FOP OP(FOP_MULP)
GO4K_PAN PANNING(80)
GO4K_OUT GAIN(12), AUXSEND(8)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument9)
GO4K_ENV ATTAC(48),DECAY(64),SUSTAIN(64),RELEASE(88),GAIN(128)
GO4K_ENV ATTAC(80),DECAY(128),SUSTAIN(128),RELEASE(128),GAIN(128)
GO4K_FOP OP(FOP_PUSH)
GO4K_FOP OP(FOP_MULP)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(8),FLAGS(SINE|LFO)
GO4K_FOP OP(FOP_MULP)
GO4K_FST AMOUNT(66),DEST(10*MAX_WORKSPACE_SLOTS+1)
GO4K_FST AMOUNT(66),DEST(11*MAX_WORKSPACE_SLOTS+1)
GO4K_FST AMOUNT(66),DEST(12*MAX_WORKSPACE_SLOTS+1)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(64),DETUNE(62),PHASE(0),GATES(0),COLOR(32),SHAPE(64),GAIN(64),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(64),DETUNE(66),PHASE(48),GATES(0),COLOR(64),SHAPE(64),GAIN(64),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(96),GATES(0),COLOR(64),SHAPE(96),GAIN(64),FLAGS(SINE)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_VCF FREQUENCY(8),RESONANCE(128),VCFTYPE(HIGHPASS)
GO4K_DST DRIVE(80), SNHFREQ(96)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(96),RESONANCE(0),VCFTYPE(BANDSTOP)
GO4K_VCF FREQUENCY(64),RESONANCE(0),VCFTYPE(BANDSTOP)
GO4K_VCF FREQUENCY(32),RESONANCE(0),VCFTYPE(BANDSTOP)
GO4K_DLL PREGAIN(96),DRY(96),FEEDBACK(64),DAMP(64),FREQUENCY(0),DEPTH(0),DELAY(18),COUNT(1)
GO4K_PAN PANNING(64)
GO4K_OUT GAIN(32), AUXSEND(24)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Global)
GO4K_ACC ACCTYPE(AUX)
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(HIGHPASS)
GO4K_DLL PREGAIN(64),DRY(0),FEEDBACK(112),DAMP(32),FREQUENCY(128),DEPTH(0),DELAY(0),COUNT(8)
GO4K_FOP OP(FOP_XCH)
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(HIGHPASS)
GO4K_DLL PREGAIN(64),DRY(0),FEEDBACK(112),DAMP(32),FREQUENCY(128),DEPTH(0),DELAY(8),COUNT(8)
GO4K_ACC ACCTYPE(OUTPUT)
GO4K_FOP OP(FOP_ADDP2)
GO4K_VCO TRANSPOSE(40),DETUNE(64),PHASE(32),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(SINE|LFO)
GO4K_FSTG AMOUNT(80),DEST(0*go4k_instrument.size*MAX_VOICES+1*MAX_WORKSPACE_SLOTS*4+7*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(65),DEST(1*go4k_instrument.size*MAX_VOICES+1*MAX_WORKSPACE_SLOTS*4+7*4+go4k_instrument.workspace)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(52),DETUNE(64),PHASE(33),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(SINE|LFO)
GO4K_FSTG AMOUNT(88),DEST(8*go4k_instrument.size*MAX_VOICES+2*MAX_WORKSPACE_SLOTS*4+7*4+go4k_instrument.workspace)
GO4K_FOP OP(FOP_POP)
GO4K_VCF FREQUENCY(72),RESONANCE(32),VCFTYPE(ALLPASS)
GO4K_VCF FREQUENCY(96),RESONANCE(64),VCFTYPE(ALLPASS)
GO4K_VCF FREQUENCY(48),RESONANCE(128),VCFTYPE(PEAK)
GO4K_FOP OP(FOP_XCH)
GO4K_VCF FREQUENCY(72),RESONANCE(32),VCFTYPE(ALLPASS)
GO4K_VCF FREQUENCY(96),RESONANCE(64),VCFTYPE(ALLPASS)
GO4K_VCF FREQUENCY(48),RESONANCE(128),VCFTYPE(PEAK)
GO4K_OUT GAIN(64), AUXSEND(0)
GO4K_END_PARAMDEF
go4k_synth_parameter_values_end
%ifdef USE_SECTIONS
section .g4kmuc5 data align=1
%else
section .data
%endif
%ifdef GO4K_USE_DLL
global _go4k_delay_times
_go4k_delay_times
dw 1116
dw 1188
dw 1276
dw 1356
dw 1422
dw 1492
dw 1556
dw 1618
dw 1140
dw 1212
dw 1300
dw 1380
dw 1446
dw 1516
dw 1580
dw 1642
dw 30240
dw 512
dw 15120
%endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
// some useful song defines for 4klang
#define SAMPLE_RATE 44100
#define BPM 135.110291
#define MAX_INSTRUMENTS 13
#define MAX_PATTERNS 68
#define PATTERN_SIZE_SHIFT 4
#define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
#define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
#define SAMPLES_PER_TICK 4896
#define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
#define POLYPHONY 2
#define FLOAT_32BIT
#define SAMPLE_TYPE float
#define WINDOWS_OBJECT
// declaration of the external synth render function, you'll always need that
extern "C" void __stdcall _4klang_render(void*);
// declaration of the external envelope buffer. access only if you're song was exported with that option
extern "C" float _4klang_envelope_buffer;
// declaration of the external note buffer. access only if you're song was exported with that option
extern "C" int _4klang_note_buffer;

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

BIN
ev14-4k/dec14.4kp Normal file

Binary file not shown.

BIN
ev14-4k/dec14.mptm Normal file

Binary file not shown.

BIN
ev14-4k/las.4kp Normal file

Binary file not shown.

BIN
ev14-4k/las.mptm Normal file

Binary file not shown.

BIN
ev14-4k/nightshift.4kp Normal file

Binary file not shown.

BIN
ev14-4k/nightshift.mptm Normal file

Binary file not shown.

BIN
ev14-4k/nightshift2.4kp Normal file

Binary file not shown.

1517
ev14-4k/project/4klang.asm Normal file

File diff suppressed because it is too large Load Diff

22
ev14-4k/project/4klang.h Normal file
View File

@@ -0,0 +1,22 @@
// some useful song defines for 4klang
#define SAMPLE_RATE 44100
#define BPM 176.118210
#define MAX_INSTRUMENTS 8
#define MAX_PATTERNS 104
#define PATTERN_SIZE_SHIFT 4
#define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
#define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
#define SAMPLES_PER_TICK 3756
#define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
#define POLYPHONY 1
#define FLOAT_32BIT
#define SAMPLE_TYPE float
#define WINDOWS_OBJECT
// declaration of the external synth render function, you'll always need that
extern "C" void __stdcall _4klang_render(void*);
// declaration of the external envelope buffer. access only if you're song was exported with that option
extern "C" float _4klang_envelope_buffer;
// declaration of the external note buffer. access only if you're song was exported with that option
extern "C" int _4klang_note_buffer;

833
ev14-4k/project/4klang.inc Normal file
View File

@@ -0,0 +1,833 @@
%macro export_func 1
global _%1
_%1:
%endmacro
%define USE_SECTIONS
%define SAMPLE_RATE 44100
%define MAX_INSTRUMENTS 8
%define MAX_VOICES 1
%define HLD 1
%define BPM 176.118210
%define MAX_PATTERNS 104
%define PATTERN_SIZE_SHIFT 4
%define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
%define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
%define SAMPLES_PER_TICK 3756
%define DEF_LFO_NORMALIZE 0.0000665602
%define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
;%define GO4K_USE_16BIT_OUTPUT
;%define GO4K_USE_GROOVE_PATTERN
%define GO4K_USE_ENVELOPE_RECORDINGS
;%define GO4K_USE_NOTE_RECORDINGS
%define GO4K_CLIP_OUTPUT
%define GO4K_USE_DST
%define GO4K_USE_DLL
%define GO4K_USE_PAN
%define GO4K_USE_GLOBAL_DLL
%define GO4K_USE_FSTG
%define GO4K_USE_ENV_CHECK
%define GO4K_USE_ENV_MOD_GM
%define GO4K_USE_ENV_MOD_ADR
%define GO4K_USE_VCO_CHECK
%define GO4K_USE_VCO_PHASE_OFFSET
%define GO4K_USE_VCO_SHAPE
%define GO4K_USE_VCO_MOD_TM
%define GO4K_USE_VCO_MOD_DM
%define GO4K_USE_VCO_MOD_CM
%define GO4K_USE_VCO_MOD_SM
%define GO4K_USE_VCF_CHECK
%define GO4K_USE_VCF_MOD_FM
%define GO4K_USE_VCF_HIGH
%define GO4K_USE_VCF_BAND
%define GO4K_USE_VCF_PEAK
%define GO4K_USE_DST_CHECK
%define GO4K_USE_DLL_CHORUS_CLAMP
%define GO4K_USE_DLL_DAMP
%define GO4K_USE_DLL_DC_FILTER
%define GO4K_USE_FSTG_CHECK
%define GO4K_USE_PAN_MOD
%define GO4K_USE_WAVESHAPER_CLIP
%define MAX_DELAY 65536
%define MAX_WORKSPACE_SLOTS 8
%define GO4K_BEGIN_CMDDEF(def_name)
%define GO4K_END_CMDDEF db 0
%define GO4K_BEGIN_PARAMDEF(def_name)
%define GO4K_END_PARAMDEF
GO4K_ENV_ID equ 1
%macro GO4K_ENV 5
db %1
db %2
db %3
db %4
db %5
%endmacro
%define ATTAC(val) val
%define DECAY(val) val
%define SUSTAIN(val) val
%define RELEASE(val) val
%define GAIN(val) val
struc go4kENV_val
.attac resd 1
.decay resd 1
.sustain resd 1
.release resd 1
.gain resd 1
.size
endstruc
struc go4kENV_wrk
.state resd 1
.level resd 1
.gm resd 1
.am resd 1
.dm resd 1
.sm resd 1
.rm resd 1
.size
endstruc
%define ENV_STATE_ATTAC 0
%define ENV_STATE_DECAY 1
%define ENV_STATE_SUSTAIN 2
%define ENV_STATE_RELEASE 3
%define ENV_STATE_OFF 4
GO4K_VCO_ID equ 2
%macro GO4K_VCO 8
db %1
db %2
%ifdef GO4K_USE_VCO_PHASE_OFFSET
db %3
%endif
%ifdef GO4K_USE_VCO_GATE
db %4
%endif
db %5
%ifdef GO4K_USE_VCO_SHAPE
db %6
%endif
db %7
db %8
%endmacro
%define TRANSPOSE(val) val
%define DETUNE(val) val
%define PHASE(val) val
%define GATES(val) val
%define COLOR(val) val
%define SHAPE(val) val
%define FLAGS(val) val
%define SINE 0x01
%define TRISAW 0x02
%define PULSE 0x04
%define NOISE 0x08
%define LFO 0x10
%define GATE 0x20
struc go4kVCO_val
.transpose resd 1
.detune resd 1
%ifdef GO4K_USE_VCO_PHASE_OFFSET
.phaseofs resd 1
%endif
%ifdef GO4K_USE_VCO_GATE
.gate resd 1
%endif
.color resd 1
%ifdef GO4K_USE_VCO_SHAPE
.shape resd 1
%endif
.gain resd 1
.flags resd 1
.size
endstruc
struc go4kVCO_wrk
.phase resd 1
.tm resd 1
.dm resd 1
.fm resd 1
.pm resd 1
.cm resd 1
.sm resd 1
.gm resd 1
.size
endstruc
GO4K_VCF_ID equ 3
%macro GO4K_VCF 3
db %1
db %2
db %3
%endmacro
%define LOWPASS 0x1
%define HIGHPASS 0x2
%define BANDPASS 0x4
%define BANDSTOP 0x3
%define ALLPASS 0x7
%define PEAK 0x8
%define FREQUENCY(val) val
%define RESONANCE(val) val
%define VCFTYPE(val) val
struc go4kVCF_val
.freq resd 1
.res resd 1
.type resd 1
.size
endstruc
struc go4kVCF_wrk
.low resd 1
.high resd 1
.band resd 1
.freq resd 1
.fm resd 1
.rm resd 1
.size
endstruc
GO4K_DST_ID equ 4
%macro GO4K_DST 2
db %1
%ifdef GO4K_USE_DST_SH
db %2
%endif
%endmacro
%define DRIVE(val) val
%define SNHFREQ(val) val
struc go4kDST_val
.drive resd 1
%ifdef GO4K_USE_DST_SH
.snhfreq resd 1
%endif
.size
endstruc
struc go4kDST_wrk
%ifdef GO4K_USE_DST_SH
.out resd 1
.snhphase resd 1
%endif
.dm resd 1
.sm resd 1
.size
endstruc
GO4K_DLL_ID equ 5
%macro GO4K_DLL 8
db %1
db %2
db %3
%ifdef GO4K_USE_DLL_DAMP
db %4
%endif
%ifdef GO4K_USE_DLL_CHORUS
db %5
db %6
%endif
db %7
db %8
%endmacro
%define PREGAIN(val) val
%define DRY(val) val
%define FEEDBACK(val) val
%define DEPTH(val) val
%define DAMP(val) val
%define DELAY(val) val
%define COUNT(val) val
struc go4kDLL_val
.pregain resd 1
.dry resd 1
.feedback resd 1
%ifdef GO4K_USE_DLL_DAMP
.damp resd 1
%endif
%ifdef GO4K_USE_DLL_CHORUS
.freq resd 1
.depth
%endif
.delay resd 1
.count resd 1
.size
endstruc
struc go4kDLL_wrk
.index resd 1
.store resd 1
.dcin resd 1
.dcout resd 1
%ifdef GO4K_USE_DLL_CHORUS
.phase resd 1
%endif
.buffer resd MAX_DELAY
.size
endstruc
struc go4kDLL_wrk2
.pm resd 1
.fm resd 1
.im resd 1
.dm resd 1
.sm resd 1
.am resd 1
.size
endstruc
GO4K_FOP_ID equ 6
%macro GO4K_FOP 1
db %1
%endmacro
%define OP(val) val
%define FOP_POP 0x1
%define FOP_ADDP 0x2
%define FOP_MULP 0x3
%define FOP_PUSH 0x4
%define FOP_XCH 0x5
%define FOP_ADD 0x6
%define FOP_MUL 0x7
%define FOP_ADDP2 0x8
%define FOP_LOADNOTE 0x9
struc go4kFOP_val
.flags resd 1
.size
endstruc
struc go4kFOP_wrk
.size
endstruc
GO4K_FST_ID equ 7
%macro GO4K_FST 2
db %1
db %2
%endmacro
%define AMOUNT(val) val
%define DEST(val) val
struc go4kFST_val
.amount resd 1
.op1 resd 1
.size
endstruc
struc go4kFST_wrk
.size
endstruc
GO4K_PAN_ID equ 8
%macro GO4K_PAN 1
%ifdef GO4K_USE_PAN
db %1
%endif
%endmacro
%define PANNING(val) val
struc go4kPAN_val
%ifdef GO4K_USE_PAN
.panning resd 1
%endif
.size
endstruc
struc go4kPAN_wrk
.pm resd 1
.size
endstruc
GO4K_OUT_ID equ 9
%macro GO4K_OUT 2
db %1
%ifdef GO4K_USE_GLOBAL_DLL
db %2
%endif
%endmacro
%define AUXSEND(val) val
struc go4kOUT_val
.gain resd 1
%ifdef GO4K_USE_GLOBAL_DLL
.auxsend resd 1
%endif
.size
endstruc
struc go4kOUT_wrk
.am resd 1
.gm resd 1
.size
endstruc
GO4K_ACC_ID equ 10
%macro GO4K_ACC 1
db %1
%endmacro
%define OUTPUT 0
%define AUX 8
%define ACCTYPE(val) val
struc go4kACC_val
.acctype resd 1
.size
endstruc
struc go4kACC_wrk
.size
endstruc
%ifdef GO4K_USE_FLD
GO4K_FLD_ID equ 11
%macro GO4K_FLD 1
db
%endmacro
%define VALUE(val) val
struc go4kFLD_val
.value resd 1
.size
endstruc
struc go4kFLD_wrk
.vm resd 1
.size
endstruc
%endif
%ifdef GO4K_USE_FSTG
GO4K_FSTG_ID equ 12
%macro GO4K_FSTG 2
db %1
dd %2
%endmacro
struc go4kFSTG_val
.amount resd 1
.op1 resd 1
.size
endstruc
struc go4kFSTG_wrk
.size
endstruc
%endif
struc go4k_instrument
.release resd 1
.note resd 1
.workspace resd 256
.dlloutl resd 1
.dlloutr resd 1
.outl resd 1
.outr resd 1
.size
endstruc
struc go4k_synth
.instruments resb go4k_instrument.size * MAX_INSTRUMENTS * MAX_VOICES
.global resb go4k_instrument.size * MAX_VOICES
.size
endstruc
%ifdef USE_SECTIONS
section .g4kmuc1 data align=1
%else
section .data align=1
%endif
go4k_patterns
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 60, 0, 65, 0, 67, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 56, 0, 60, 0, 63, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 58, 0, 62, 0, 65, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 55, 0, 58, 0, 62, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 55, 0, 59, 0, 62, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 65, 0, 68, 0, 70, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 61, 0, 63, 0, 65, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 63, 0, 65, 0, 68, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 72, HLD, HLD, HLD, HLD, 0, 72, 0, 0, 0, 0, 0, 72, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0,
db 68, HLD, HLD, HLD, HLD, 0, 68, 0, 0, 0, 0, 0, 68, HLD, HLD, HLD,
db 70, HLD, HLD, HLD, HLD, 0, 70, 0, 0, 0, 0, 0, 70, HLD, HLD, HLD,
db 67, HLD, HLD, HLD, HLD, 0, 67, 0, 0, 0, 0, 0, 67, HLD, HLD, HLD,
db 60, 0, 60, 0, 60, 0, 60, 0, 60, 0, 60, 0, 60, 0, 60, 0,
db 60, 0, 0, 0, 68, HLD, HLD, HLD, HLD, HLD, 66, HLD, HLD, HLD, HLD, HLD,
db 60, 0, 0, 0, 56, HLD, HLD, HLD, HLD, HLD, 58, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 75, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 65, HLD, HLD, HLD, HLD, 0, 65, 0, 0, 0, 0, 0, 65, HLD, HLD, HLD,
db 61, HLD, HLD, HLD, HLD, 0, 61, 0, 0, 0, 0, 0, 61, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 68, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 63, HLD, HLD, HLD, HLD, 0, 63, 0, 0, 0, 0, 0, 63, HLD, HLD, HLD,
db 65, 0, 65, 0, 65, 0, 65, 0, 65, 0, 65, 0, 65, 0, 65, 0,
db 65, 0, 0, 0, 61, HLD, HLD, HLD, HLD, HLD, 63, HLD, HLD, HLD, HLD, HLD,
db 65, 0, 65, 0, 65, 0, 65, 0, 53, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 60, HLD, 60, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, HLD,
db 60, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 60, HLD, 60, HLD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
db 0, 0, 0, 0, 0, 0, 0, 0, 60, HLD, 0, 0, 0, 0, 0, 0,
db 0, 0, 60, HLD, 60, HLD, 60, HLD, 0, 0, 60, HLD, 60, HLD, 60, HLD,
db 0, 0, 60, 60, 60, HLD, 60, HLD, 0, 0, 60, HLD, 60, HLD, 60, HLD,
db 0, 0, 60, HLD, 60, HLD, 60, HLD, 0, 0, 0, 0, 0, 0, 0, 0,
db 36, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, 44, HLD, HLD, HLD, HLD, HLD, 42, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, 44, HLD, HLD, HLD, HLD, HLD, 46, HLD, HLD, HLD, HLD, HLD,
db 48, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 44, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 46, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 43, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 41, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 49, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 51, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db HLD, HLD, HLD, HLD, 37, HLD, HLD, HLD, HLD, HLD, 39, HLD, HLD, HLD, HLD, HLD,
db 87, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 84, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 86, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 83, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 92, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 89, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 91, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 88, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, HLD, 72, HLD,
db 74, HLD, 75, HLD, 12, HLD, 72, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0,
db 70, HLD, 72, HLD, 12, HLD, 72, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0,
db 0, 0, 0, 0, 0, 0, 65, HLD, 67, HLD, 72, HLD, 74, HLD, 75, HLD,
db 75, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 12, HLD, HLD, HLD, 67, HLD, 12, HLD,
db 75, HLD, 74, HLD, HLD, HLD, 72, HLD, HLD, 12, 67, HLD, HLD, HLD, 68, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, HLD, 12, HLD,
db 77, HLD, 75, HLD, HLD, HLD, 74, HLD, HLD, 12, 72, HLD, HLD, HLD, 70, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, HLD, 12, HLD,
db 77, HLD, 75, HLD, HLD, HLD, 74, HLD, HLD, 12, 72, HLD, HLD, HLD, 71, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, HLD, 12, HLD,
db 80, HLD, 79, HLD, HLD, HLD, 77, HLD, HLD, 12, 72, HLD, HLD, HLD, 73, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, HLD, 12, HLD,
db 82, HLD, 80, HLD, HLD, HLD, 79, HLD, HLD, 12, 77, HLD, HLD, HLD, 75, HLD,
db 0, 0, 0, 0, 0, 0, 0, 0, 19, HLD, HLD, HLD, 72, HLD, 12, HLD,
db 82, HLD, 80, HLD, HLD, HLD, 79, HLD, HLD, 12, 77, HLD, HLD, HLD, 76, HLD,
db 77, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD, HLD,
go4k_patterns_end
%ifdef USE_SECTIONS
section .g4kmuc2 data align=1
%else
section .data
%endif
go4k_pattern_lists
Instrument0List db 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 1, 0, 2, 0, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 1, 0, 2, 0, 3, 0, 5, 0, 6, 0, 7, 0, 8, 0, 1, 0, 6, 0, 7, 0, 8, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Instrument1List db 9, 10, 11, 10, 12, 10, 13, 10, 9, 10, 11, 10, 12, 10, 13, 10, 14, 14, 14, 15, 14, 14, 14, 16, 14, 14, 14, 15, 14, 14, 14, 16, 9, 10, 11, 17, 12, 10, 13, 10, 9, 10, 11, 17, 12, 10, 13, 10, 14, 14, 14, 15, 14, 14, 14, 16, 14, 14, 14, 15, 14, 14, 14, 16, 9, 10, 11, 17, 12, 10, 13, 10, 9, 10, 11, 17, 12, 10, 13, 10, 18, 10, 19, 20, 21, 10, 9, 10, 18, 10, 19, 20, 21, 10, 9, 10, 22, 22, 22, 23, 22, 22, 24, 10,
Instrument2List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 27, 0,
Instrument3List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
Instrument4List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 31, 0,
Instrument5List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 33, 33, 34, 32, 33, 33, 35, 32, 33, 33, 34, 32, 33, 33, 35, 36, 33, 37, 33, 38, 33, 39, 33, 36, 33, 37, 33, 38, 33, 39, 33, 32, 33, 33, 34, 32, 33, 33, 35, 32, 33, 33, 34, 32, 33, 33, 35, 36, 33, 37, 33, 38, 33, 39, 33, 36, 33, 37, 33, 38, 33, 39, 33, 40, 33, 41, 33, 42, 33, 36, 33, 40, 33, 41, 33, 42, 33, 36, 33, 40, 33, 33, 43, 40, 33, 40, 10,
Instrument6List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 33, 45, 33, 46, 33, 33, 0, 44, 33, 45, 33, 46, 33, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 33, 45, 33, 46, 33, 33, 0, 44, 33, 45, 33, 46, 33, 47, 33, 48, 33, 49, 33, 50, 33, 44, 33, 48, 33, 49, 33, 50, 33, 51, 33, 48, 33, 0, 0, 0, 0, 0, 0,
Instrument8List db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 0, 54, 52, 53, 0, 55, 56, 57, 33, 0, 58, 59, 33, 0, 60, 57, 33, 0, 58, 61, 33, 0, 62, 63, 33, 0, 64, 65, 33, 0, 66, 63, 33, 0, 64, 67, 33, 0, 68, 0, 0, 0, 0, 0, 0, 0,
go4k_pattern_lists_end
%ifdef USE_SECTIONS
section .g4kmuc3 data align=1
%else
section .data
%endif
go4k_synth_instructions
GO4K_BEGIN_CMDDEF(Instrument0)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_DLL_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument1)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_DST_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FST_ID
db GO4K_DLL_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument2)
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_ENV_ID
db GO4K_DST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FST_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument3)
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FST_ID
db GO4K_VCO_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument4)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument5)
db GO4K_ENV_ID
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument6)
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_VCO_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_ENV_ID
db GO4K_FST_ID
db GO4K_FST_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_PAN_ID
db GO4K_DLL_ID
db GO4K_FOP_ID
db GO4K_DLL_ID
db GO4K_FOP_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Instrument8)
db GO4K_ENV_ID
db GO4K_VCO_ID
db GO4K_VCF_ID
db GO4K_VCO_ID
db GO4K_FOP_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_VCF_ID
db GO4K_DST_ID
db GO4K_FOP_ID
db GO4K_DLL_ID
db GO4K_PAN_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
GO4K_BEGIN_CMDDEF(Global)
db GO4K_ACC_ID
db GO4K_DLL_ID
db GO4K_FOP_ID
db GO4K_DLL_ID
db GO4K_ACC_ID
db GO4K_DLL_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_VCF_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FOP_ID
db GO4K_VCO_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FSTG_ID
db GO4K_FOP_ID
db GO4K_OUT_ID
GO4K_END_CMDDEF
go4k_synth_instructions_end
%ifdef USE_SECTIONS
section .g4kmuc4 data align=1
%else
section .data
%endif
go4k_synth_parameter_values
GO4K_BEGIN_PARAMDEF(Instrument0)
GO4K_ENV ATTAC(0),DECAY(64),SUSTAIN(32),RELEASE(76),GAIN(128)
GO4K_VCO TRANSPOSE(88),DETUNE(64),PHASE(0),GATES(85),COLOR(0),SHAPE(64),GAIN(128),FLAGS(SINE)
GO4K_VCO TRANSPOSE(88),DETUNE(64),PHASE(0),GATES(85),COLOR(0),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(88),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_FST AMOUNT(80),DEST(9*MAX_WORKSPACE_SLOTS+0)
GO4K_FOP OP(FOP_MULP)
GO4K_DLL PREGAIN(64),DRY(128),FEEDBACK(64),DAMP(0),FREQUENCY(0),DEPTH(0),DELAY(16),COUNT(1)
GO4K_PAN PANNING(64)
GO4K_OUT GAIN(48), AUXSEND(32)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument1)
GO4K_ENV ATTAC(16),DECAY(64),SUSTAIN(64),RELEASE(72),GAIN(128)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(PULSE)
GO4K_VCO TRANSPOSE(52),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(SINE)
GO4K_FST AMOUNT(96),DEST(5*MAX_WORKSPACE_SLOTS+5)
GO4K_FOP OP(FOP_ADDP)
GO4K_VCO TRANSPOSE(40),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(127),GAIN(128),FLAGS(TRISAW|LFO)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(32),RESONANCE(32),VCFTYPE(LOWPASS)
GO4K_DST DRIVE(32), SNHFREQ(128)
GO4K_VCO TRANSPOSE(52),DETUNE(64),PHASE(0),GATES(0),COLOR(64),SHAPE(64),GAIN(64),FLAGS(SINE)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_MULP)
GO4K_FST AMOUNT(96),DEST(14*MAX_WORKSPACE_SLOTS+0)
GO4K_DLL PREGAIN(64),DRY(128),FEEDBACK(64),DAMP(0),FREQUENCY(0),DEPTH(0),DELAY(16),COUNT(1)
GO4K_PAN PANNING(32)
GO4K_OUT GAIN(128), AUXSEND(24)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument2)
GO4K_ENV ATTAC(32),DECAY(32),SUSTAIN(96),RELEASE(64),GAIN(128)
GO4K_FST AMOUNT(128),DEST(0*MAX_WORKSPACE_SLOTS+2)
GO4K_ENV ATTAC(32),DECAY(70),SUSTAIN(0),RELEASE(0),GAIN(128)
GO4K_DST DRIVE(32), SNHFREQ(128)
GO4K_FST AMOUNT(80),DEST(6*MAX_WORKSPACE_SLOTS+1)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(45),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(66),GAIN(128),FLAGS(SINE)
GO4K_FOP OP(FOP_MULP)
GO4K_FST AMOUNT(60),DEST(9*MAX_WORKSPACE_SLOTS+0)
GO4K_PAN PANNING(56)
GO4K_OUT GAIN(72), AUXSEND(0)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument3)
GO4K_ENV ATTAC(0),DECAY(80),SUSTAIN(0),RELEASE(80),GAIN(128)
GO4K_FST AMOUNT(128),DEST(0*MAX_WORKSPACE_SLOTS+2)
GO4K_ENV ATTAC(0),DECAY(56),SUSTAIN(0),RELEASE(0),GAIN(128)
GO4K_FST AMOUNT(108),DEST(6*MAX_WORKSPACE_SLOTS+1)
GO4K_FST AMOUNT(72),DEST(7*MAX_WORKSPACE_SLOTS+1)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(16),DETUNE(64),PHASE(64),GATES(85),COLOR(64),SHAPE(64),GAIN(32),FLAGS(SINE)
GO4K_VCO TRANSPOSE(52),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(80),GAIN(96),FLAGS(SINE)
GO4K_FST AMOUNT(72),DEST(16*MAX_WORKSPACE_SLOTS+0)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(64),FLAGS(NOISE)
GO4K_VCF FREQUENCY(104),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(24),RESONANCE(32),VCFTYPE(HIGHPASS)
GO4K_VCF FREQUENCY(20),RESONANCE(64),VCFTYPE(BANDSTOP)
GO4K_PAN PANNING(72)
GO4K_OUT GAIN(8), AUXSEND(1)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument4)
GO4K_ENV ATTAC(0),DECAY(58),SUSTAIN(0),RELEASE(0),GAIN(96)
GO4K_VCO TRANSPOSE(64),DETUNE(64),PHASE(64),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(NOISE)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(128),RESONANCE(128),VCFTYPE(HIGHPASS)
GO4K_PAN PANNING(80)
GO4K_OUT GAIN(16), AUXSEND(32)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument5)
GO4K_ENV ATTAC(64),DECAY(64),SUSTAIN(96),RELEASE(64),GAIN(128)
GO4K_ENV ATTAC(0),DECAY(72),SUSTAIN(64),RELEASE(64),GAIN(128)
GO4K_FST AMOUNT(88),DEST(9*MAX_WORKSPACE_SLOTS+4)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(64),DETUNE(68),PHASE(0),GATES(85),COLOR(0),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(64),DETUNE(60),PHASE(0),GATES(85),COLOR(0),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_VCO TRANSPOSE(76),DETUNE(64),PHASE(0),GATES(85),COLOR(8),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_ADDP)
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_FOP OP(FOP_MULP)
GO4K_PAN PANNING(64)
GO4K_OUT GAIN(128), AUXSEND(24)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument6)
GO4K_ENV ATTAC(72),DECAY(96),SUSTAIN(96),RELEASE(88),GAIN(96)
GO4K_FST AMOUNT(64),DEST(0*MAX_WORKSPACE_SLOTS+2)
GO4K_VCO TRANSPOSE(32),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(90),GAIN(128),FLAGS(SINE|LFO)
GO4K_FST AMOUNT(68),DEST(6*MAX_WORKSPACE_SLOTS+2)
GO4K_FST AMOUNT(61),DEST(7*MAX_WORKSPACE_SLOTS+2)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(64),DETUNE(62),PHASE(32),GATES(85),COLOR(80),SHAPE(64),GAIN(128),FLAGS(PULSE)
GO4K_VCO TRANSPOSE(64),DETUNE(68),PHASE(32),GATES(85),COLOR(96),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_MULP)
GO4K_ENV ATTAC(92),DECAY(128),SUSTAIN(0),RELEASE(0),GAIN(128)
GO4K_FST AMOUNT(80),DEST(14*MAX_WORKSPACE_SLOTS+4)
GO4K_FST AMOUNT(80),DEST(15*MAX_WORKSPACE_SLOTS+4)
GO4K_FOP OP(FOP_POP)
GO4K_VCF FREQUENCY(16),RESONANCE(128),VCFTYPE(PEAK)
GO4K_VCF FREQUENCY(48),RESONANCE(64),VCFTYPE(LOWPASS)
GO4K_PAN PANNING(64)
GO4K_DLL PREGAIN(96),DRY(128),FEEDBACK(96),DAMP(64),FREQUENCY(0),DEPTH(0),DELAY(17),COUNT(1)
GO4K_FOP OP(FOP_XCH)
GO4K_DLL PREGAIN(96),DRY(128),FEEDBACK(64),DAMP(64),FREQUENCY(0),DEPTH(0),DELAY(18),COUNT(1)
GO4K_FOP OP(FOP_XCH)
GO4K_OUT GAIN(0), AUXSEND(8)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Instrument8)
GO4K_ENV ATTAC(48),DECAY(64),SUSTAIN(128),RELEASE(88),GAIN(128)
GO4K_VCO TRANSPOSE(64),DETUNE(63),PHASE(0),GATES(0),COLOR(96),SHAPE(64),GAIN(128),FLAGS(PULSE)
GO4K_VCF FREQUENCY(64),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_VCO TRANSPOSE(64),DETUNE(65),PHASE(0),GATES(0),COLOR(96),SHAPE(64),GAIN(128),FLAGS(TRISAW)
GO4K_FOP OP(FOP_ADDP)
GO4K_FOP OP(FOP_PUSH)
GO4K_VCF FREQUENCY(48),RESONANCE(64),VCFTYPE(BANDPASS)
GO4K_FOP OP(FOP_XCH)
GO4K_VCF FREQUENCY(72),RESONANCE(64),VCFTYPE(BANDPASS)
GO4K_FOP OP(FOP_ADDP)
GO4K_VCF FREQUENCY(72),RESONANCE(128),VCFTYPE(LOWPASS)
GO4K_VCF FREQUENCY(32),RESONANCE(64),VCFTYPE(HIGHPASS)
GO4K_DST DRIVE(96), SNHFREQ(128)
GO4K_FOP OP(FOP_MULP)
GO4K_DLL PREGAIN(64),DRY(128),FEEDBACK(64),DAMP(0),FREQUENCY(0),DEPTH(0),DELAY(16),COUNT(1)
GO4K_PAN PANNING(64)
GO4K_OUT GAIN(32), AUXSEND(32)
GO4K_END_PARAMDEF
GO4K_BEGIN_PARAMDEF(Global)
GO4K_ACC ACCTYPE(AUX)
GO4K_DLL PREGAIN(80),DRY(128),FEEDBACK(112),DAMP(48),FREQUENCY(0),DEPTH(0),DELAY(0),COUNT(8)
GO4K_FOP OP(FOP_XCH)
GO4K_DLL PREGAIN(80),DRY(128),FEEDBACK(112),DAMP(48),FREQUENCY(0),DEPTH(0),DELAY(8),COUNT(8)
GO4K_ACC ACCTYPE(OUTPUT)
GO4K_DLL PREGAIN(96),DRY(0),FEEDBACK(0),DAMP(0),FREQUENCY(0),DEPTH(0),DELAY(19),COUNT(1)
GO4K_FOP OP(FOP_ADDP2)
GO4K_VCF FREQUENCY(12),RESONANCE(64),VCFTYPE(HIGHPASS)
GO4K_FOP OP(FOP_XCH)
GO4K_VCF FREQUENCY(12),RESONANCE(64),VCFTYPE(HIGHPASS)
GO4K_FOP OP(FOP_XCH)
GO4K_VCO TRANSPOSE(52),DETUNE(64),PHASE(64),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(SINE|LFO)
GO4K_FSTG AMOUNT(52),DEST(4*go4k_instrument.size*MAX_VOICES+0*MAX_WORKSPACE_SLOTS*4+2*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(63),DEST(4*go4k_instrument.size*MAX_VOICES+0*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FOP OP(FOP_POP)
GO4K_VCO TRANSPOSE(16),DETUNE(64),PHASE(64),GATES(0),COLOR(64),SHAPE(64),GAIN(128),FLAGS(SINE|LFO)
GO4K_FSTG AMOUNT(68),DEST(7*go4k_instrument.size*MAX_VOICES+8*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(88),DEST(7*go4k_instrument.size*MAX_VOICES+3*MAX_WORKSPACE_SLOTS*4+6*4+go4k_instrument.workspace)
GO4K_FSTG AMOUNT(66),DEST(1*go4k_instrument.size*MAX_VOICES+7*MAX_WORKSPACE_SLOTS*4+4*4+go4k_instrument.workspace)
GO4K_FOP OP(FOP_POP)
GO4K_OUT GAIN(32), AUXSEND(0)
GO4K_END_PARAMDEF
go4k_synth_parameter_values_end
%ifdef USE_SECTIONS
section .g4kmuc5 data align=1
%else
section .data
%endif
%ifdef GO4K_USE_DLL
global _go4k_delay_times
_go4k_delay_times
dw 1116
dw 1188
dw 1276
dw 1356
dw 1422
dw 1492
dw 1556
dw 1618
dw 1140
dw 1212
dw 1300
dw 1380
dw 1446
dw 1516
dw 1580
dw 1642
dw 30047
dw 7511
dw 15023
dw 512
%endif

BIN
ev14-4k/project/4klang.obj Normal file

Binary file not shown.

BIN
ev14-4k/project/GlU32.Lib Normal file

Binary file not shown.

Binary file not shown.

341
ev14-4k/project/Shaders.cpp Normal file
View File

@@ -0,0 +1,341 @@
#include "Shaders.h"
//#define DEBUG_COMPRESSED_SHADER
#ifdef _DEBUG
PFNGLCREATESHADERPROC glCreateShader = NULL;
PFNGLSHADERSOURCEPROC glShaderSource = NULL;
PFNGLCOMPILESHADERPROC glCompileShader = NULL;
PFNGLGETSHADERIVPROC glGetShaderiv = NULL;
PFNGLGETPROGRAMIVPROC glGetProgramiv = NULL;
PFNGLCREATEPROGRAMPROC glCreateProgram = NULL;
PFNGLATTACHSHADERPROC glAttachShader = NULL;
PFNGLLINKPROGRAMPROC glLinkProgram = NULL;
PFNGLUSEPROGRAMPROC glUseProgram = NULL;
PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog = NULL;
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog = NULL;
void useProgram(GLhandleARB ah_Program)
{
glUseProgram(ah_Program);
}
void initShaders()
{
glCreateShader = (PFNGLCREATESHADERPROC)myGetProcAddress("glCreateShader");
glShaderSource = (PFNGLSHADERSOURCEPROC)myGetProcAddress("glShaderSource");
glCompileShader = (PFNGLCOMPILESHADERPROC)myGetProcAddress("glCompileShader");
glGetShaderiv = (PFNGLGETSHADERIVPROC)myGetProcAddress("glGetShaderiv");
glGetProgramiv = (PFNGLGETPROGRAMIVPROC)myGetProcAddress("glGetProgramiv");
glCreateProgram = (PFNGLCREATEPROGRAMPROC)myGetProcAddress("glCreateProgram");
glAttachShader = (PFNGLATTACHSHADERPROC)myGetProcAddress("glAttachShader");
glLinkProgram = (PFNGLLINKPROGRAMPROC)myGetProcAddress("glLinkProgram");
glUseProgram = (PFNGLUSEPROGRAMPROC)myGetProcAddress("glUseProgram");
glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)myGetProcAddress("glGetShaderInfoLog");
glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)myGetProcAddress("glGetProgramInfoLog");
if (!(glCreateShader && glShaderSource && glCompileShader && glGetShaderiv && glGetProgramiv && glCreateProgram && glAttachShader && glLinkProgram && glUseProgram && glGetShaderInfoLog && glGetProgramInfoLog))
{
std::cerr << "Some shader functions are not available!" << std::endl;
}
}
#include <sstream>
#include <fstream>
std::string ReplaceString(const std::string &stringSearchString, const std::string &stringReplaceString, std::string stringStringToReplace)
{
std::string::size_type pos = stringStringToReplace.find(stringSearchString, 0);
int intLengthSearch = stringSearchString.length();
int intLengthReplacment = stringReplaceString.length();
while(std::string::npos != pos)
{
stringStringToReplace.replace(pos, intLengthSearch, stringReplaceString);
pos = stringStringToReplace.find(stringSearchString, pos + intLengthReplacment);
}
return stringStringToReplace;
}
std::string MakeFileName( const char* as_FileName, int ShaderID, bool bDebug )
{
std::stringstream ss;
ss << as_FileName << "_" << ShaderID;
if( bDebug )
{
ss << "_dbg";
}
return ss.str();
}
void CreateSubShader( const char* as_FileName, int ShaderID, bool bDebug )
{
char* ls_ShaderSource = textFileRead(as_FileName);
std::string strData= ls_ShaderSource;
std::string strNewData;
bool bRemove= false;
for( size_t i= 0; i < strData.size(); ++i )
{
bool bEndRemove= false;
if( strData[ i ] == '@' )
{
if( i + 2 >= strData.size() )
{
break;
}
i++;
if( strData[ i ] == '@' )
{
bRemove= false;
}
else if( strData[ i ] == 'D' )
{
bRemove= !bDebug;
}
else
{
int ID= (int)(strData[ i ] - '0');
bRemove= ID!=ShaderID;
}
i++;
}
if( !bRemove || strData[ i ] == 10 || strData[ i ] == 13)
{
strNewData+= strData[ i ];
}
}
std::string strFileOut= MakeFileName( as_FileName, ShaderID, bDebug );
std::ofstream ofs(strFileOut.c_str());
// some Renaming
/*strNewData= ReplaceString( "rayDir","q", strNewData);
strNewData= ReplaceString( "cRes","b", strNewData);
strNewData= ReplaceString( "cFac","a", strNewData);
strNewData= ReplaceString( "CurStep","d", strNewData);
strNewData= ReplaceString( "CurStep","d", strNewData);
strNewData= ReplaceString( "rotate","r", strNewData);
strNewData= ReplaceString( "repeatHex","sh", strNewData);
strNewData= ReplaceString( "repeat","s", strNewData);
strNewData= ReplaceString( "pi2","P", strNewData);
strNewData= ReplaceString( "sqrtOf075","Q", strNewData);
strNewData= ReplaceString( "EndlessBar","O", strNewData);
strNewData= ReplaceString( "CurTime","R", strNewData);
strNewData= ReplaceString( "CurScene","S", strNewData);
strNewData= ReplaceString( "torus","T", strNewData);
strNewData= ReplaceString( "noise3D","N", strNewData);
strNewData= ReplaceString( "smoothnoise","M", strNewData);*/
ofs << strNewData;
}
void CreateAllSubShader( const char* as_FileName )
{
for( int i= 0; i < MAX_SHADER_ID; ++i )
{
CreateSubShader( as_FileName, i, true );
CreateSubShader( as_FileName, i, false );
}
}
void PrintErrors()
{
GLenum lr_Error = GL_NO_ERROR;
int li_ErrorCount = 5;
do
{
lr_Error = glGetError();
if (lr_Error != GL_NO_ERROR)
{
li_ErrorCount--;
char* ls_ErrorString = (char*)gluErrorString(lr_Error);
if (ls_ErrorString != 0)
std::cout << "OPENGL :: ERROR " << ls_ErrorString << std::endl;
}
if (li_ErrorCount == 0)
{
std::cout << "OPENGL :: ERROR Too many errors!" << std::endl;
break;
}
} while (lr_Error != GL_NO_ERROR);
}
GLhandleARB createVertexShader(const char* as_FileName)
{
GLhandleARB lh_Shader = 0;
char* ls_ShaderSource = textFileRead(as_FileName);
if (ls_ShaderSource == NULL)
{
std::cerr << "Error reading file: " << as_FileName << std::endl;
return lh_Shader;
}
lh_Shader = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(lh_Shader, 1, (const char**)&ls_ShaderSource, NULL);
glCompileShader(lh_Shader);
free(ls_ShaderSource);
_printShaderInfoLog(lh_Shader);
return lh_Shader;
}
#ifdef DEBUG_COMPRESSED_SHADER
#include "shader_code.h"
#endif
GLhandleARB createFragmentShader(const char* as_FileName, int ShaderID, bool bDebug)
{
CreateAllSubShader( as_FileName );
GLhandleARB lh_Shader = 0;
char* ls_ShaderSource = textFileRead(MakeFileName(as_FileName, ShaderID, bDebug).c_str());
if (ls_ShaderSource == NULL)
{
std::cerr << "Error reading file: " << as_FileName << std::endl;
return lh_Shader;
}
lh_Shader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(lh_Shader, 1, (const char**)&ls_ShaderSource, NULL);
#ifdef DEBUG_COMPRESSED_SHADER
glShaderSource(lh_Shader, 1, (const char**)&mark_fs, NULL);
#endif
glCompileShader(lh_Shader);
_printShaderInfoLog(lh_Shader);
free(ls_ShaderSource);
return lh_Shader;
}
GLhandleARB createProgram(GLhandleARB ah_VertexShader, GLhandleARB ah_FragmentShader)
{
GLhandleARB lh_Program = 0;
if (ah_VertexShader + ah_FragmentShader <= 1)
{
std::cerr << "Cannot create program." << std::endl;
return lh_Program;
}
lh_Program = glCreateProgram();
glAttachShader(lh_Program, ah_VertexShader);
glAttachShader(lh_Program, ah_FragmentShader);
glLinkProgram(lh_Program);
_printProgramInfoLog(lh_Program);
return lh_Program;
}
char* textFileRead(const char* as_FileName)
{
FILE* lh_File;
char* ls_Content = NULL;
size_t li_Count = 0;
if (as_FileName != NULL)
{
fopen_s(&lh_File, as_FileName, "rt");
if (lh_File != NULL)
{
fseek(lh_File, 0, SEEK_END);
li_Count = ftell(lh_File);
rewind(lh_File);
if (li_Count > 0)
{
ls_Content = (char*) malloc(sizeof(char) * (li_Count + 1));
li_Count = fread(ls_Content, sizeof(char), li_Count, lh_File);
ls_Content[li_Count] = '\0';
}
fclose(lh_File);
}
}
return ls_Content;
}
void _printShaderInfoLog(GLhandleARB ah_Shader)
{
int li_InfologLength = 0;
int li_CharsWritten = 0;
char* li_InfoLog;
glGetShaderiv(ah_Shader, GL_INFO_LOG_LENGTH, &li_InfologLength);
if (li_InfologLength > 0)
{
li_InfoLog = (char*) malloc(li_InfologLength);
glGetShaderInfoLog(ah_Shader, li_InfologLength, &li_CharsWritten, li_InfoLog);
std::cerr << li_InfoLog << std::endl;
free(li_InfoLog);
}
}
void _printProgramInfoLog(GLhandleARB ah_Program)
{
int li_InfologLength = 0;
int li_CharsWritten = 0;
char* ls_InfoLog;
glGetProgramiv(ah_Program, GL_INFO_LOG_LENGTH, &li_InfologLength);
if (li_InfologLength > 0)
{
ls_InfoLog = (char *)malloc(li_InfologLength);
glGetProgramInfoLog(ah_Program, li_InfologLength, &li_CharsWritten, ls_InfoLog);
std::cerr << ls_InfoLog << std::endl;
free(ls_InfoLog);
}
}
bool printShaderStatistics()
{
if (GL_VERSION_2_1) std::cout << "Supports OpenGL 2.1. " << std::endl;
else if (GL_VERSION_2_0) std::cout << "Supports OpenGL 2.0. " << std::endl;
else if (GL_VERSION_1_5) std::cout << "Supports OpenGL 1.5. " << std::endl;
else if (GL_VERSION_1_4) std::cout << "Supports OpenGL 1.4. " << std::endl;
else if (GL_VERSION_1_3) std::cout << "Supports OpenGL 1.3. " << std::endl;
else if (GL_VERSION_1_2) std::cout << "Supports OpenGL 1.2. " << std::endl;
else if (GL_VERSION_1_1) std::cout << "Supports OpenGL 1.1. " << std::endl;
if (GL_ARB_shader_objects && GL_ARB_vertex_shader && GL_ARB_fragment_shader)
{
std::cout << "Status: Using GLSL " << glGetString(GL_SHADING_LANGUAGE_VERSION_ARB) << std::endl;
}
else
{
std::cerr << "No GLSL support!" << std::endl;
return false;
}
return true;
}
#endif

21
ev14-4k/project/Shaders.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#define MAX_SHADER_ID 4
#include <windows.h>
#include <iostream>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glext.h"
#define myGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
void initShaders();
GLhandleARB createVertexShader(const char* as_FileName);
GLhandleARB createFragmentShader(const char* as_FileName, int ShaderID, bool bDebug);
GLhandleARB createProgram(GLhandleARB ah_VertexShader, GLhandleARB ah_FragmentShader);
void PrintErrors();
void useProgram(GLhandleARB ah_Program);
char* textFileRead(const char* as_FileName);
void _printShaderInfoLog(GLhandleARB ah_Shader);
void _printProgramInfoLog(GLhandleARB ah_Program);
bool printShaderStatistics();

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -0,0 +1,98 @@
°°°
°°°°°
°°°°°°°
°°°°°°°°°
°°°°°°°°°°
°°°°°°°°°°°
°±±± °°°°°°°°°°°
°±±±± °°°°°°°°°°°°
°±±±±±± °°°°°°°°°°°
°±±±±±±± °°°°°°°°°°°
°±±±±±±±±° °°°°°°°°°°°
±±±±±±±±±° °°°°°°°°°°°°
±±±±±±±±±± °°°°°°°°°°°°
±±±±±±±±±±± °°°°°°°°°°°°
±±±±±±±±±±± °°°°°°°°°°°°°
±±±±±±±±±±± °°°°°°°°°°°°°
°±±±±±±±±±±° °°°°°°°°°°°°°
°±±±±±±±±±±° °°°°°°°°°°°°°
±±±±±±±±±±±° °°°°°°°°°°°°
±±±±±±±±±±±±° ±°°°°°°°°°°°
±±±±±±±±±±±±±° ±±±±±±°°°°°
°±±±±±±±±±±±±± ±±±±±±±±±±±
°±±±±±±±±±±±±°±±±±±±±±±±±
±±±±±±±±±±ÛÛÛÛ±±±±±±±±
°±±±±±±ÛÛÛÛÛÛÛÛÛÛÛ±±±
±±±±ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
±±±ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ±
²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ±
²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ±
²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ±°
²²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ±°
°²²²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ±
°²²²²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°
°²²²²²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°
°²²²²²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°
°²²²²²²²²²²²²²ÛÛÛÛÛÛÛÛÛÛÛÛÛ°
°²²²²²²²²²²²²²°°°°
°°°°°°°°°
ÛÛÛÛÛÛÛÛÜ ÛÛ ÜÛÛÛÛÛÛÛÛß ÛÛ ÜÛÛÛÛÛÛß
ÛÛ ÛÛ ÛÛ ÛÛß ÛÛ ÛÛß
ÛÛÛÛÛÛÛÛÛÛÛ ÛÛ ÛÛ ÜÛÛß ÛÛÛÛÛÛÛÛÛß ÛÛ ÜÜÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛß
ÛÛ ÛÛ ÛÛ ÛÛ ÜÛÛß ÛÛ ÛÛ ÜÛÛß ÛÛ ÛÛ ÛÛ ÛÛ ÛÛß
ÛÛ ÛÛ ÛÛ ÛÛ ÜÛÛ ÛÛ ÛÛ ÛÛß ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ
ÛÛÛÛÛÛÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛÛÛß ÛÛ ÛÛ ÛÛÛÛÛÛÛ ÛÛ ÛÛ ÛÛ ÛÛÛ ÛÛÛÛÛÛÛÛÛß
@ REVISION 2014
presents
°°±±±±±±±±°°°
°°±±²²ÛÛÛÛÛÛÛÛÛÛ²±°°
°±²²ÛÛÛÛ²²²²²²²²²²²²²±±°
±²²ÛÛÛ²²²²±±±±±±±±±±²²²²²°°
²²²ÛÛ²²±±±±±°°°°°°°°°°°±²²²²°
°²²²Û²±±±°°° °±Û²²²±
±²²²²±°°° °±²ÛÛ²²²°
±²²²²±° °±²ÛÛÛ²²²±±°°
°²²²²²±±°°°°°±±²ÛÛÛÛÛ²²²±±±±°°
°±²²²²²²ÛÛÛÛÛÛ²²²²²²±±±°°°°°
°±±±±²²²²²²²²²²²±±±°°°°°
Û ° °°±±±±²²²±Û±°°Û°°° ²
Û °°°°°°°Û°° ² ²
±²Û ² ±²Û ±°²°Û ±²Û ² ² ²² ² ±²Û ±°²°Û ±²Û ² ² ²²
°± Û ² ±Ü ±±²±Û ÜÛ ²±² ²° ² ±Ü² ±±²±Û ±Ü² ²±² ²°
°± Û ² ßÛ ±°²°Û ±ßÛ ²°² ² ² ±ß ±°²°Û ±ß ²°² ²
±²Û ² ±²Û ± ² Û ±²Û ² ² ²²Û ²Û ±²Û ± ² Û ±²Û ² ² ²²Û
------- INFO -------
TGGC: Code and Graphics
xTr1m: Music and Code
Tools used:
crinkler by Mentor/TBC & Blueberry/Loonies
Shader Minifier by Ctrl+Alt+Test
4klang by Gopher/Alcatraz
------- BluFlame greets -------
Approximate, ASD, Brainstorm, CNCD, Ctrl+Alt+Test, Conspiracy,
Fairlight, Farbrausch, FRequency, Haujobb, Loonies, Mercury,
Nuance, Panda Cube, Quite, RGBA, SQNY, Still, TBC, TBL,
TRSi, Titan, Traction, UF&DD, Youth Uprising
ASCII by:
mrplow
xTr1m

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
ev14-4k/project/bin/rc2.zip Normal file

Binary file not shown.

369
ev14-4k/project/bp4k.vcproj Normal file
View File

@@ -0,0 +1,369 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="bp4k"
ProjectGUID="{213903DE-E40A-4D23-9310-E520AC2B412E}"
RootNamespace="bp4k"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(SolutionDir)obj\$(ProjectName)_$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
CallingConvention="2"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Gdi32.lib user32.lib opengl32.lib winmm.lib glu32.lib"
OutputFile="$(OutDir)\$(ProjectName)_$(ConfigurationName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(ProjectDir)&quot;"
GenerateDebugInformation="true"
SubSystem="1"
EntryPointSymbol="main"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(SolutionDir)obj\$(ProjectName)_$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="rem minify\shader_minifier.exe &quot;mark.fs_0&quot; -o mark_0.h -v --no-renaming&#x0D;&#x0A;rem minify\shader_minifier.exe &quot;mark.fs_1&quot; -o mark_1.h -v --no-renaming&#x0D;&#x0A;rem minify\shader_minifier.exe &quot;mark.fs_2&quot; -o mark_2.h -v --no-renaming&#x0D;&#x0A;rem minify\shader_minifier.exe &quot;mark.fs_0&quot; -o mark_small.h -v&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
WholeProgramOptimization="false"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="0"
DebugInformationFormat="3"
CallingConvention="2"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/CRINKLER"
AdditionalDependencies="Gdi32.lib user32.lib opengl32.lib winmm.lib libcmt.lib"
OutputFile="$(OutDir)\$(ProjectName)_$(ConfigurationName).exe"
AdditionalLibraryDirectories="&quot;$(ProjectDir)&quot;"
GenerateManifest="false"
ManifestFile=""
GenerateDebugInformation="true"
SubSystem="2"
LinkTimeCodeGeneration="0"
EntryPointSymbol="main"
TargetMachine="1"
ErrorReporting="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Compress (Slow)|Win32"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(SolutionDir)obj\$(ProjectName)_$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/QIfist"
Optimization="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
WholeProgramOptimization="false"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="false"
FloatingPointModel="2"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="0"
DebugInformationFormat="0"
CallingConvention="2"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/CRINKLER /COMPMODE:SLOW /ORDERTRIES:4000 /HASHTRIES:300 /UNSAFEIMPORT /TRUNCATEFLOATS:24 /HASHSIZE:200 /REPORT:report.html /RANGE:opengl32 /PROGRESSGUI /TRANSFORM:CALLS"
AdditionalDependencies="opengl32.lib winmm.lib"
OutputFile="$(OutDir)\$(ProjectName)_$(ConfigurationName).exe"
AdditionalLibraryDirectories="&quot;$(ProjectDir)&quot;"
GenerateManifest="false"
ManifestFile=""
GenerateDebugInformation="false"
SubSystem="2"
LinkTimeCodeGeneration="0"
EntryPointSymbol="main"
TargetMachine="1"
ErrorReporting="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\main.cpp"
>
</File>
<File
RelativePath=".\Shaders.cpp"
>
</File>
<File
RelativePath=".\synth.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\glext.h"
>
</File>
<File
RelativePath=".\release.h"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
AdditionalDependencies=""
Outputs=""
/>
</FileConfiguration>
<FileConfiguration
Name="Compress (Slow)|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
AdditionalDependencies=""
Outputs=""
/>
</FileConfiguration>
</File>
<File
RelativePath=".\Shaders.h"
>
</File>
<File
RelativePath=".\small.h"
>
</File>
<File
RelativePath=".\synth.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\4klang.obj"
>
</File>
<File
RelativePath=".\generic.vs"
>
</File>
<File
RelativePath=".\mark.fs"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Compress (Slow)|Win32">
<Configuration>Compress (Slow)</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{213903DE-E40A-4D23-9310-E520AC2B412E}</ProjectGuid>
<RootNamespace>bp4k</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)_$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)_$(Configuration)\</IntDir>
<GenerateManifest>false</GenerateManifest>
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)_$(Configuration)\</IntDir>
<GenerateManifest>false</GenerateManifest>
<TargetName>$(ProjectName)_$(Configuration)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CallingConvention>StdCall</CallingConvention>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
</ClCompile>
<Link>
<AdditionalDependencies>Gdi32.lib;user32.lib;opengl32.lib;winmm.lib;glu32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_$(Configuration).exe</OutputFile>
<AdditionalLibraryDirectories>$(ProjectDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<EntryPointSymbol>main</EntryPointSymbol>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>rem minify\shader_minifier.exe "mark.fs_0" -o mark_0.h -v --no-renaming
rem minify\shader_minifier.exe "mark.fs_1" -o mark_1.h -v --no-renaming
rem minify\shader_minifier.exe "mark.fs_2" -o mark_2.h -v --no-renaming
rem minify\shader_minifier.exe "mark.fs_0" -o mark_small.h -v
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>StdCall</CallingConvention>
</ClCompile>
<Link>
<AdditionalDependencies>Gdi32.lib;user32.lib;opengl32.lib;winmm.lib;libcmt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_$(Configuration).exe</OutputFile>
<AdditionalLibraryDirectories>$(ProjectDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile />
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<LinkTimeCodeGeneration />
<EntryPointSymbol>main</EntryPointSymbol>
<TargetMachine>MachineX86</TargetMachine>
<LinkErrorReporting />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>/QIfist %(AdditionalOptions)</AdditionalOptions>
<Optimization>MinSpace</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<DebugInformationFormat>None</DebugInformationFormat>
<CallingConvention>StdCall</CallingConvention>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<OmitFramePointers>true</OmitFramePointers>
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<EnableParallelCodeGeneration>false</EnableParallelCodeGeneration>
</ClCompile>
<Link>
<AdditionalOptions>/CRINKLER /COMPMODE:SLOW /ORDERTRIES:4000 /HASHTRIES:300 /UNSAFEIMPORT /TRUNCATEFLOATS:24 /HASHSIZE:200 /REPORT:report.html /RANGE:opengl32 /PROGRESSGUI /TRANSFORM:CALLS %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_$(Configuration).exe</OutputFile>
<AdditionalLibraryDirectories>$(ProjectDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile />
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<LinkTimeCodeGeneration />
<EntryPointSymbol>main</EntryPointSymbol>
<TargetMachine>MachineX86</TargetMachine>
<LinkErrorReporting />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.compress.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="main.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="main_rel.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Shaders.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\hgplus\obliterator\syncprototype\syncprototype\timeline.h" />
<ClInclude Include="4klang.h" />
<ClInclude Include="glext.h" />
<ClInclude Include="mark_small.h" />
<ClInclude Include="Shaders.h" />
<ClInclude Include="synth.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="4klang.asm">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">yasm-1.2.0-win32.exe -f win32 -o 4klang.obj 4klang.asm</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">Compiling 4klang...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">4klang.obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Compress (Slow)|Win32'">4klang.inc</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">yasm-1.2.0-win32.exe -f win32 -o 4klang.obj 4klang.asm</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling 4klang...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4klang.obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4klang.inc</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">yasm-1.2.0-win32.exe -f win32 -o 4klang.obj 4klang.asm</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling 4klang...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4klang.obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4klang.inc</AdditionalInputs>
</CustomBuild>
<None Include="4klang.inc" />
<None Include="generic.vs">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="mark.fs" />
<None Include="mark.fs_0" />
</ItemGroup>
<ItemGroup>
<Object Include="4klang.obj" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Shaders.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main_rel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.compress.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="glext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Shaders.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="synth.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="4klang.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mark_small.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\hgplus\obliterator\syncprototype\syncprototype\timeline.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="generic.vs" />
<None Include="mark.fs" />
<None Include="mark.fs_0" />
<None Include="4klang.inc">
<Filter>Header Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="4klang.asm">
<Filter>Source Files</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<Object Include="4klang.obj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,3 @@
mkdir obj\intro
cl /c /GS- /Qpar- /analyze- /W0 /Gy- /Zc:wchar_t /Gm- /O1 /Ob2 /Fd"obj/intro/vc120.pdb" /fp:fast /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "SCREENWIDTH"=%1 /D "SCREENHEIGHT"=%2 /D "ASPECTOFFSET"=%3 /errorReport:prompt /WX- /Zc:forScope /GR- /arch:IA32 /Gz /Oy /Oi /MT /Fa"obj/intro/" /nologo /Fo"obj/intro/" /Os /Fp"obj/intro/intro.pch" main.compress.cpp
link /OUT:"bin/intro_%1x%2.exe" "opengl32.lib" "winmm.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "obj/intro/main.compress.obj" "4klang.obj" /ENTRY:"main" /SUBSYSTEM:WINDOWS /CRINKLER /COMPMODE:SLOW /ORDERTRIES:20000 /HASHTRIES:1500 /UNSAFEIMPORT /TRUNCATEFLOATS:24 /HASHSIZE:350 /REPORT:report.html /RANGE:opengl32 /PROGRESSGUI /TRANSFORM:CALLS

View File

@@ -0,0 +1,13 @@
@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
REM 16:9
call build 1280 720 0.388f
call build 1920 1080 0.388f
REM 16:10
call build 1680 1050 0.3f
REM 4:3
call build 1024 768 0.166f
call build 800 600 0.166f
REM 5:4
call build 1280 1024 0.125f

View File

@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bp4k", "bp4k.vcxproj", "{213903DE-E40A-4D23-9310-E520AC2B412E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Compress (Slow)|Win32 = Compress (Slow)|Win32
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{213903DE-E40A-4D23-9310-E520AC2B412E}.Compress (Slow)|Win32.ActiveCfg = Compress (Slow)|Win32
{213903DE-E40A-4D23-9310-E520AC2B412E}.Compress (Slow)|Win32.Build.0 = Compress (Slow)|Win32
{213903DE-E40A-4D23-9310-E520AC2B412E}.Debug|Win32.ActiveCfg = Debug|Win32
{213903DE-E40A-4D23-9310-E520AC2B412E}.Debug|Win32.Build.0 = Debug|Win32
{213903DE-E40A-4D23-9310-E520AC2B412E}.Release|Win32.ActiveCfg = Release|Win32
{213903DE-E40A-4D23-9310-E520AC2B412E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@@ -0,0 +1,9 @@
varying vec4 Y;
varying vec2 Z;
void main()
{
Y = gl_Color;
Z = (gl_Vertex.xy*vec2(1.6,1.0))*0.5+0.5;
gl_Position = gl_Vertex;
}

13146
ev14-4k/project/glext.h Normal file

File diff suppressed because it is too large Load Diff

BIN
ev14-4k/project/link.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,312 @@
#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include "synth.h"
#include <GL/gl.h>
#include "glext.h"
#include "mark_small.h"
#ifndef SCREENWIDTH
#define SCREENWIDTH 1280
#endif
#ifndef SCREENHEIGHT
#define SCREENHEIGHT 720
#endif
#ifndef ASPECTOFFSET
#define ASPECTOFFSET 0.375f
#endif
#pragma data_seg(".aspect")
static float aspect = ASPECTOFFSET;
#define SHADER_WARMUP
#define WINDOWED
#pragma data_seg(".Shader0")
#include "mark_small.h"
#pragma data_seg(".pfd")
static const PIXELFORMATDESCRIPTOR pfd = {
0, 1, PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 8
};
#pragma data_seg(".dmScreenSettings")
static DEVMODE dmScreenSettings = {
"", 0, 0, sizeof(dmScreenSettings), 0, DM_PELSWIDTH | DM_PELSHEIGHT,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, SCREENWIDTH, SCREENHEIGHT
};
#pragma data_seg(".fltused")
int _fltused = 1;
#pragma bss_seg(".mainbss")
static int gCurScene = 0;
static int gCurSceneStart = 0;
static float lf_Time = 0.0f;
#pragma data_seg(".g_SceneLength")
int g_SceneLength[] =
{
16, 16,
16, 8, 8, 8, 8, 16,
8, 8, 16, 16,
16, 16, 16, 16,
0x80000000
};
#pragma data_seg(".g_SceneShader")
int g_SceneShader[] =
{
0, 0,
0, 0, 0, 0, 0, 0,
1, 1, 1, 1,
2, 2, 2, 2
};
#pragma data_seg(".glCreateShaderProgramEXT")
static const char* sglCreateShaderProgramEXT = "glCreateShaderProgramEXT";
#pragma data_seg(".glUseProgram")
static const char* sglUseProgram = "glUseProgram";
#pragma data_seg(".glUniform4f")
static const char* sglUniform4f = "glUniform4f";
#define shaderCountOffset 12
#define ATOM_EDIT 0xC018
#define ATOM_STATIC 0xC019
#pragma code_seg(".main")
void _cdecl main()
{
_asm
{
xor esi, esi
#ifndef WINDOWED
push esi
push esi
push esi
push esi
push esi
push esi
push esi
push esi
push WS_POPUP | WS_VISIBLE | WS_MAXIMIZE
push esi
push ATOM_STATIC
push esi
push CDS_FULLSCREEN
push offset dmScreenSettings
call ChangeDisplaySettings
call CreateWindowExA
#else
push esi
push esi
push esi
push esi
push SCREENHEIGHT
push SCREENWIDTH
push esi
push esi
push WS_EX_APPWINDOW | WS_VISIBLE | WS_SYSMENU
push esi
push ATOM_STATIC
push esi
call CreateWindowExA
#endif
push eax
call GetDC
mov edi, eax
push edi
push edi
push offset pfd
push offset pfd
push edi
call ChoosePixelFormat
push eax
push edi
call SetPixelFormat
call wglCreateContext
push eax
push edi
call wglMakeCurrent
call SwapBuffers
}
_asm
{
push 32 // waveOutOpen/waveOutWrite
push offset WaveHDR
push esi
push esi
push esi
push offset WaveFMT
push - 1
push offset hWaveOut
push 1024 // Sleep
push esi // CreateThread
push esi
push offset lpSoundBuffer
push _4klang_render
push esi
push esi
push FALSE // ShowCursor
#ifdef SHADER_WARMUP
push 1 // glRecti
push 1
push - 1
push - 1
push 3 // glUseProgram
push sglUseProgram
#endif
push offset mark_fs_0 // glCreateShaderProgramEXT
push GL_FRAGMENT_SHADER
push sglCreateShaderProgramEXT
#ifdef SHADER_WARMUP
push 1 // glRecti
push 1
push - 1
push - 1
push 2 // glUseProgram
push sglUseProgram
#endif
push offset mark_fs_0 // glCreateShaderProgramEXT
push GL_FRAGMENT_SHADER
push sglCreateShaderProgramEXT
#ifdef SHADER_WARMUP
push 1 // glRecti
push 1
push - 1
push - 1
push 1 // glUseProgram
push sglUseProgram
#endif
push offset mark_fs_0 // glCreateShaderProgramEXT
push GL_FRAGMENT_SHADER
push sglCreateShaderProgramEXT
call wglGetProcAddress
call eax
#ifdef SHADER_WARMUP
call wglGetProcAddress
call eax
call glRecti
#endif
inc byte ptr[mark_fs_0 + 0xC]
call wglGetProcAddress
call eax
#ifdef SHADER_WARMUP
call wglGetProcAddress
call eax
call glRecti
#endif
inc byte ptr[mark_fs_0 + 0xC]
call wglGetProcAddress
call eax
#ifdef SHADER_WARMUP
call wglGetProcAddress
call eax
call glRecti
#endif
inc byte ptr[mark_fs_0 + 0xC]
call ShowCursor
call CreateThread
call Sleep
call waveOutOpen
push hWaveOut
call waveOutWrite
}
_asm
{
introloop:
push 12
push offset MMTime
push hWaveOut
call waveOutGetPosition
mov ecx, MMTime.u.sample
sub ecx, gCurSceneStart // ecx = Sample
mov eax, gCurScene
imul ebx, [eax * 4 + g_SceneLength], SAMPLES_PER_TICK * 8 // ebx = SceneEnd
mov eax, [eax * 4 + g_SceneShader]
inc eax
push eax
mov lf_Time, ecx
fild lf_Time
mov lf_Time, ebx
fild lf_Time
fdiv
fst lf_Time
push sglUseProgram
call wglGetProcAddress
call eax
sub esp, 0x10
fld aspect
fstp dword ptr[esp + 0xc]
fild dword ptr[dmScreenSettings.dmPelsHeight]
fstp dword ptr[esp + 0x8]
fld lf_Time
fstp dword ptr[esp + 0x4]
fild gCurScene
fstp dword ptr[esp]
push esi
push sglUniform4f
call wglGetProcAddress
call eax
push VK_ESCAPE
push esi
push esi
push esi
push esi
push esi
push edi
push 1
push 1
push -1
push -1
call glRecti
call SwapBuffers
fld1
fcomp dword ptr[lf_Time]
fnstsw ax
test ah, 0x5
jp peekmessage
add dword ptr[gCurSceneStart], ebx
inc dword ptr[gCurScene]
peekmessage:
call PeekMessage
cmp dword ptr[MMTime.u.sample], MAX_SAMPLES
jae exit
call GetAsyncKeyState
test ax, ax
jz introloop
exit:
push esi
call ExitProcess
}
//} while (MMTime.u.sample < MAX_SAMPLES && !GetAsyncKeyState(VK_ESCAPE));
}

View File

538
ev14-4k/project/main.cpp Normal file
View File

@@ -0,0 +1,538 @@
//#define NOMUSICTIMING
#define MULTISHADER
#ifdef _DEBUG
#include <time.h>
#include <io.h>
#include <process.h>
#include "Shaders.h"
#include "synth.h"
#include "4klang.h"
#else
#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include <windows.h>
#include <stdio.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glext.h"
#include "synth.h"
#include "4klang.h"
#ifdef NOMUSICTIMING
#include "Mmsystem.h"
#endif
#define V_Y "Y"
#define V_Z "Z"
#ifndef ASPECT
#define ASPECT 1.78
#endif
#ifndef SCREENWIDTH
#define SCREENWIDTH 1280
#endif
#ifndef SCREENHEIGTH
#define SCREENHEIGTH 720
#endif
#define WINDOWED
#include "mark_small.h"
#define STR2(x) #x
#define STR(x) STR2(x)
//static char* vsh = "varying vec4 Y;varying vec2 Z;void main(){Y=gl_Color;Z=(gl_Vertex.xy*vec2(Y.w,1))*.5+.5;gl_Position=gl_Vertex;}";
static char* vsh = "varying vec4 "V_Y";varying vec2 "V_Z";void main(){"V_Y"=gl_Color;"V_Z"=(gl_Vertex.xy*vec2("STR( ASPECT )",1))*.5+.5;gl_Position=gl_Vertex;}";
#endif
#ifdef _DEBUG
#define HALF_FAC 1
static const int gi_ScreenWidth = 1280/HALF_FAC;
static const int gi_ScreenHeight = 720/HALF_FAC;
#else
static const int gi_ScreenWidth = SCREENWIDTH;
static const int gi_ScreenHeight = SCREENHEIGTH ;
#endif
#pragma data_seg(".glUniform4f")
static const char* glUniform4f = "glUniform4f";
#ifdef _DEBUG
HANDLE gh_ShaderCompileEvent;
static char** gs_LastShader_;
static __time64_t gi_ShaderChangedDate;
static unsigned int gi_ShaderProgram;
static unsigned int gi_LastShaderProgram;
static const char* gs_VertexShader = "generic.vs";
static const char* gs_ShaderFile = "mark.fs";
#endif
static const PIXELFORMATDESCRIPTOR pfd={
0, 1, PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 8
};
static DEVMODE dmScreenSettings={
"",0,0,sizeof(dmScreenSettings),0,DM_PELSWIDTH|DM_PELSHEIGHT,
0,0,0,0,0,0,0,0,0,0,0,0,0,"",0,0,gi_ScreenWidth,gi_ScreenHeight
};
__forceinline unsigned int compileShader(const char* vsh, const char* fsh)
{
GLuint s,p;
p = ((PFNGLCREATEPROGRAMPROC)wglGetProcAddress("glCreateProgram"))();
s = ((PFNGLCREATESHADERPROC)(wglGetProcAddress("glCreateShader")))(GL_VERTEX_SHADER);
((PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource")) (s, 1, &vsh, NULL);
((PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader"))(s);
((PFNGLATTACHSHADERPROC)wglGetProcAddress("glAttachShader")) (p,s);
s = ((PFNGLCREATESHADERPROC)wglGetProcAddress("glCreateShader"))(GL_FRAGMENT_SHADER);
((PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource")) (s, 1, &fsh, NULL);
((PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader"))(s);
((PFNGLATTACHSHADERPROC)wglGetProcAddress("glAttachShader")) (p,s);
((PFNGLLINKPROGRAMPROC)wglGetProcAddress("glLinkProgram"))(p);
#ifndef MULTISHADER
((PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram"))(p);
#endif
return p;
}
#ifdef _DEBUG
#define CHECK_DEBUG_OUTPUT(shader) \
{\
GLint success = 0;\
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);\
if (!success)\
{\
GLchar infoLog[16384];\
glGetShaderInfoLog(shader, 16384, NULL, infoLog);\
OutputDebugString(infoLog);\
}\
}
#else
#define CHECK_DEBUG_OUTPUT(shader)
#endif
#ifdef _DEBUG
DWORD WINAPI filemon(void* args)
{
while (true)
{
_finddata_t fdata;
long hfile = _findfirst(gs_ShaderFile, &fdata);
if (hfile != -1)
{
if (fdata.time_write != gi_ShaderChangedDate)
{
gi_ShaderChangedDate = fdata.time_write;
::SetEvent(gh_ShaderCompileEvent);
std::cout << "Shader loaded." << std::endl;
}
_findclose(hfile);
}
::Sleep(100);
}
return 0;
}
#endif
#ifdef _DEBUG
#include <cmath>
float g_DebugCamPos[ 3 ]= {0,2.0f,-5.0f};
float g_DebugCamRot[ 2 ]= {0,0};
bool g_ShaderDebug= true;
int g_ShaderID= 0;
int g_SceneID= 0;
int g_MaxSceneID= 16;
float g_fSqrAnimFac= 0.0f;
float g_fSpeedFac= 8.0f;
bool g_bForceCompile= true;
void MoveCam( float& fCurTime )
{
float fSpeed= 0.25f;
bool bShift= GetAsyncKeyState( VK_SHIFT ) || GetAsyncKeyState( VK_MBUTTON ) || GetAsyncKeyState( VK_RBUTTON );
bool bStrg= GetAsyncKeyState( VK_CONTROL ) != 0;
float a= g_DebugCamRot[ 0 ];
float b= g_DebugCamRot[ 1 ];
float g_Forward[ 3 ]= {sinf( a )*cosf(b),-sinf(b), cosf( a )*cosf(b)};
float g_Right[ 3 ]= {cosf( a ),0, -sinf( a )};
if( bShift )
{
if(bStrg)
{
fSpeed *= 4.0f;
}
if( GetAsyncKeyState( VK_HOME ) && bStrg)
{
g_DebugCamPos[ 0 ]= 0.0f;
g_DebugCamPos[ 1 ]= 2.0f;
g_DebugCamPos[ 2 ]= -5.0f;
g_DebugCamRot[ 0 ]= 0.0f;
g_DebugCamRot[ 1 ]= 0.0f;
}
if( GetAsyncKeyState( 'W' ) )
{
g_DebugCamPos[ 0 ]+= fSpeed * g_Forward[ 0 ];
g_DebugCamPos[ 1 ]+= fSpeed * g_Forward[ 1 ];
g_DebugCamPos[ 2 ]+= fSpeed * g_Forward[ 2 ];
}
if( GetAsyncKeyState( 'S' ) )
{
g_DebugCamPos[ 0 ]-= fSpeed * g_Forward[ 0 ];
g_DebugCamPos[ 1 ]-= fSpeed * g_Forward[ 1 ];
g_DebugCamPos[ 2 ]-= fSpeed * g_Forward[ 2 ];
}
if( GetAsyncKeyState( 'A' ) )
{
g_DebugCamPos[ 0 ]-= fSpeed * g_Right[ 0 ];
g_DebugCamPos[ 1 ]-= fSpeed * g_Right[ 1 ];
g_DebugCamPos[ 2 ]-= fSpeed * g_Right[ 2 ];
}
if( GetAsyncKeyState( 'D' ) )
{
g_DebugCamPos[ 0 ]+= fSpeed * g_Right[ 0 ];
g_DebugCamPos[ 1 ]+= fSpeed * g_Right[ 1 ];
g_DebugCamPos[ 2 ]+= fSpeed * g_Right[ 2 ];
}
if( GetAsyncKeyState( 'F' ) )
{
g_DebugCamPos[ 1 ]+= fSpeed;
}
if( GetAsyncKeyState( 'V' ) )
{
g_DebugCamPos[ 1 ]-= fSpeed;
}
if( bStrg )
{
if( ( GetAsyncKeyState( VK_F2 ) & 1 ) != 0)
{
g_ShaderDebug= !g_ShaderDebug;
g_bForceCompile= true;
}
if( ( GetAsyncKeyState( VK_F3 ) & 1 ) != 0)
{
g_ShaderID= (g_ShaderID + MAX_SHADER_ID - 1 ) % MAX_SHADER_ID;
g_bForceCompile= true;
}
if( ( GetAsyncKeyState( VK_F4 ) & 1 )!= 0)
{
g_ShaderID= (g_ShaderID + MAX_SHADER_ID + 1 ) % MAX_SHADER_ID;
g_bForceCompile= true;
}
if( ( GetAsyncKeyState( VK_F7 ) & 1 ) != 0)
{
g_SceneID= (g_SceneID + g_MaxSceneID - 1 ) % g_MaxSceneID;
}
if( ( GetAsyncKeyState( VK_F8 ) & 1 )!= 0)
{
g_SceneID= (g_SceneID + g_MaxSceneID + 1 ) % g_MaxSceneID;
}
if( ( GetAsyncKeyState( VK_F9 ) & 1 ) != 0)
{
g_fSqrAnimFac-= 1.0f;
}
if( ( GetAsyncKeyState( VK_F10 ) & 1 )!= 0)
{
g_fSqrAnimFac+= 1.0f;
}
}
else
{
if( ( GetAsyncKeyState( VK_F6 ) & 1 )!= 0)
{
fCurTime= 0.0f;
}
if( ( GetAsyncKeyState( VK_F7 ) & 1 )!= 0)
{
g_fSpeedFac*= 2.0f;
if( g_fSpeedFac > 32.0f )
{
g_fSpeedFac= 32.0f;
}
}
if( ( GetAsyncKeyState( VK_F8 ) & 1 ) != 0)
{
g_fSpeedFac/= 2.0f;
if( g_fSpeedFac < 2.0f )
{
g_fSpeedFac= 2.0f;
}
}
}
}
static POINT OldCurPos;
POINT CurPos;
GetCursorPos( &CurPos );
if( bShift )
{
g_DebugCamRot[ 0 ]-= 0.003f * ( OldCurPos.x - CurPos.x );
g_DebugCamRot[ 1 ]-= 0.003f * ( OldCurPos.y - CurPos.y );
g_DebugCamRot[ 1 ]= max( g_DebugCamRot[ 1 ], -1.56f );
g_DebugCamRot[ 1 ]= min( g_DebugCamRot[ 1 ], 1.56f );
}
OldCurPos= CurPos;
}
#endif
#ifdef _DEBUG
LRESULT MessageCallback(HWND ar_Handle, UINT aw_Message, WPARAM aw_Param, LPARAM al_Param)
{
return DefWindowProc(ar_Handle, aw_Message, aw_Param, al_Param);
}
#endif
int gCurScene= 0;
int gCurSceneStart= 0;
int g_SceneLength[]=
{
16, 16, 16,
16, 16, 16,
16, 32, 16,
16, 16, 16,
0x80000000
};
int g_SceneShader[]=
{
0,0,0,
1,1,1,
2,2,2,
3,3,3,
};
float g_SceneFactor[]=
{
0, 0, 0,
0, 0, 1.0f,
0, 0, 1.0f,
0, 1.0f, 1.0f,
0,
};
void _cdecl main()
{
#ifdef _DEBUG
//ChangeDisplaySettings (&dmScreenSettings,CDS_FULLSCREEN);
//HDC hDC = GetDC(CreateWindow("edit", 0, WS_POPUP | WS_VISIBLE | WS_MAXIMIZE, 0, 0, 0, 0, 0, 0, 0, 0));
//HWND hWnd = CreateWindow("MDICLIENT", "Test", WS_OVERLAPPED | WS_VISIBLE | WS_SYSMENU, 0, 0, gi_ScreenWidth, gi_ScreenHeight, 0, 0, 0, 0);
WNDCLASSEX wndclass;
wndclass.cbSize = sizeof (wndclass) ;
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wndclass.lpfnWndProc = (WNDPROC)MessageCallback ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = NULL ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (DKGRAY_BRUSH) ;
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = "Window" ;
wndclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ;
RegisterClassEx(&wndclass);
HWND hWnd = CreateWindow(
"Window", /* Classname */
"Title", /* Title Text */
WS_EX_APPWINDOW, /* default window */
10, /* Windows decides the position */
30, /* where the window ends up on the screen */
gi_ScreenWidth, /* The programs width */
gi_ScreenHeight, /* and height in pixels */
NULL, /* The window is a child-window to desktop */
NULL, /* No menu */
GetModuleHandle(NULL), //GetModuleHandle(NULL), /* Program Instance handler */
NULL /* No Window Creation data */
);
HDC hDC = GetDC(hWnd);
SetPixelFormat(hDC, ChoosePixelFormat(hDC, &pfd), &pfd);
wglMakeCurrent(hDC, wglCreateContext(hDC));
initShaders();
gh_ShaderCompileEvent = ::CreateEvent(NULL, FALSE, FALSE, TEXT("WriteEvent"));
SetThreadPriority((HANDLE)CreateThread(0, 0, &filemon, 0, 0, 0), THREAD_PRIORITY_BELOW_NORMAL);
ShowWindow (hWnd , SW_NORMAL );
::Sleep(100);
#else
#ifndef WINDOWED
ChangeDisplaySettings (&dmScreenSettings,CDS_FULLSCREEN);
HDC hDC = GetDC(CreateWindow("edit", 0, WS_POPUP | WS_VISIBLE | WS_MAXIMIZE, 0, 0, 0, 0, 0, 0, 0, 0));
#else
HDC hDC = GetDC(CreateWindow("static", "RED", WS_EX_APPWINDOW | WS_VISIBLE | WS_SYSMENU, 0, 0, gi_ScreenWidth, gi_ScreenHeight, 0, 0, 0, 0));
#endif
SetPixelFormat(hDC, ChoosePixelFormat(hDC, &pfd), &pfd);
wglMakeCurrent(hDC, wglCreateContext(hDC));
#ifdef MULTISHADER
unsigned int shaders[4];
mark_fs_0[6]= '0';
shaders[0]=compileShader(vsh, mark_fs_0 ),
mark_fs_0[6]= '1';
shaders[1]=compileShader(vsh, mark_fs_0 ),
mark_fs_0[6]= '2';
shaders[2]=compileShader(vsh, mark_fs_0 ),
mark_fs_0[6]= '3';
shaders[3]=compileShader(vsh, mark_fs_0 ),
#else
compileShader(vsh, mark_fs_0 );
#endif
ShowCursor(FALSE);
#endif
#ifdef _DEBUG
if (::WaitForSingleObject(gh_ShaderCompileEvent, 0) == WAIT_OBJECT_0)
{
::Sleep(250);
gi_ShaderProgram = createProgram(
createVertexShader(gs_VertexShader),
createFragmentShader(gs_ShaderFile, g_ShaderID, g_ShaderDebug ));
((PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram"))(gi_ShaderProgram);
PrintErrors();
}
glColor4f(0,0, (GLfloat)gi_ScreenWidth, (GLfloat)gi_ScreenHeight);
glRectf(-1, -1, 1, 1);
SwapBuffers(hDC);
#endif
#ifndef _DEBUG
InitSound();
#else
LARGE_INTEGER li_OldTime = { 0 };
#endif
#ifdef NOMUSICTIMING
int iStartTick= timeGetTime();
#endif
float lf_Time= 0.0f;
do
{
#ifdef _DEBUG
MSG msg;
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
return;
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
if (::WaitForSingleObject(gh_ShaderCompileEvent, 0) == WAIT_OBJECT_0 || g_bForceCompile)
{
::Sleep(50);
gi_ShaderProgram = createProgram(
createVertexShader(gs_VertexShader),
createFragmentShader(gs_ShaderFile, g_ShaderID, g_ShaderDebug));
((PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram"))(gi_ShaderProgram);
PrintErrors();
g_bForceCompile= false;
}
#endif
get_Sample();
int Sample= MMTime.u.sample - gCurSceneStart;
int SceneEnd = g_SceneLength[gCurScene] * SAMPLES_PER_TICK * 8;//samples per tick
#ifdef NOMUSICTIMING
lf_Time = ( timeGetTime() - iStartTick ) * 0.001f / 16.0f;
#endif
glLoadIdentity();
#ifdef _DEBUG
LARGE_INTEGER li_CurrentTime, li_CurrentFrequency;
QueryPerformanceCounter(&li_CurrentTime);
QueryPerformanceFrequency(&li_CurrentFrequency);
//lf_Time = (float)li_CurrentTime.QuadPart / (float)li_CurrentFrequency.QuadPart;
float lf_DiffTime = (float)(li_CurrentTime.QuadPart - li_OldTime.QuadPart) / (float)li_CurrentFrequency.QuadPart;
char windowText[255];
sprintf_s(
windowText,
"Shader: %d Scene: %d AnimFac: %2.2f FPS: %.2f, Render time: %.4fms",
g_ShaderID,
g_SceneID,
g_fSqrAnimFac,
1.0f / lf_DiffTime,
lf_DiffTime );
::SetWindowTextA(hWnd, windowText);
li_OldTime = li_CurrentTime;
lf_Time+= lf_DiffTime * 145.0f / 60.0f / g_fSpeedFac;
if( lf_Time > 1.0f )
{
lf_Time= 0.0f;
if (g_fSqrAnimFac < 0.0)
{
g_SceneID = (g_SceneID + 1) % 16;
}
}
((PFNGLUNIFORM4FPROC)wglGetProcAddress(glUniform4f))(0, (float)g_SceneID, lf_Time * abs(g_fSqrAnimFac), (GLfloat)gi_ScreenHeight, (GLfloat)0.375f);
#else
#ifdef MULTISHADER
((PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram"))(shaders[ g_SceneShader[ gCurScene ] ]);
#endif
lf_Time= (float)Sample / (float)SceneEnd;
glColor4f((float)gCurScene, lf_Time, gi_ScreenWidth, gi_ScreenHeight);
#endif
#ifdef _DEBUG
MoveCam( lf_Time );
float fDebugData[ 16 ];
fDebugData[ 0 ]= g_DebugCamPos[ 0 ];
fDebugData[ 1 ]= g_DebugCamPos[ 1 ];
fDebugData[ 2 ]= g_DebugCamPos[ 2 ];
fDebugData[ 4 ]= g_DebugCamRot[ 0 ];
fDebugData[ 5 ]= g_DebugCamRot[ 1 ];
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf((GLfloat*)&fDebugData);
#endif
glRects(-1, -1, 1, 1);
SwapBuffers(hDC);
#ifndef _DEBUG
if( Sample > SceneEnd )
{
gCurSceneStart+= SceneEnd;
gCurScene++;
}
#endif
}
#ifdef _DEBUG
while ( !GetAsyncKeyState(VK_ESCAPE) );
#else
while ( g_SceneLength[ gCurScene ] > 0 && !GetAsyncKeyState(VK_ESCAPE) );
#endif
ExitProcess(0);
}

View File

@@ -0,0 +1,164 @@
#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include "synth.h"
#include <GL/gl.h>
#include "glext.h"
#include "mark_small.h"
#ifndef SCREENWIDTH
#define SCREENWIDTH 1280
#endif
#ifndef SCREENHEIGHT
#define SCREENHEIGHT 720
#endif
#ifndef ASPECTOFFSET
#define ASPECTOFFSET 0.375f
#endif
#define WINDOWED
#pragma data_seg(".Shader0")
#include "mark_small.h"
#pragma data_seg(".pfd")
static const PIXELFORMATDESCRIPTOR pfd = {
0, 1, PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 8
};
#pragma data_seg(".dms")
static DEVMODE dmScreenSettings = {
"", 0, 0, sizeof(dmScreenSettings), 0, DM_PELSWIDTH | DM_PELSHEIGHT,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, SCREENWIDTH, SCREENHEIGHT
};
#pragma data_seg(".fltused")
int _fltused = 1;
#pragma bss_seg(".mainbss")
static int gCurScene = 0;
static int gCurSceneStart = 0;
static float lf_Time = 0.0f;
static unsigned int shaders[3];
#pragma data_seg(".g_SceneLength")
int g_SceneLength[] =
{
16, 16,
16, 8, 8, 8, 8, 16,
8, 8, 16, 16,
16, 16, 16, 16,
0x80000000
};
#pragma data_seg(".g_SceneShader")
int g_SceneShader[] =
{
0, 0,
0, 0, 0, 0, 0, 0,
1, 1, 1, 1,
2, 2, 2, 2
};
#pragma data_seg(".glCreateShaderProgramEXT")
static const char* sglCreateShaderProgramEXT = "glCreateShaderProgramEXT";
#pragma data_seg(".glUseProgram")
static const char* sglUseProgram = "glUseProgram";
#pragma data_seg(".glUniform4f")
static const char* sglUniform4f = "glUniform4f";
#define shaderCountOffset 12
#ifdef _DEBUG
void _printProgramInfoLog(GLhandleARB ah_Program)
{
int li_InfologLength = 0;
int li_CharsWritten = 0;
((PFNGLGETPROGRAMIVPROC)wglGetProcAddress("glGetProgramiv"))(ah_Program, GL_INFO_LOG_LENGTH, &li_InfologLength);
if (li_InfologLength > 0)
{
static char ls_InfoLog[65536];
((PFNGLGETPROGRAMINFOLOGPROC)wglGetProcAddress("glGetProgramInfoLog"))(ah_Program, li_InfologLength, &li_CharsWritten, ls_InfoLog);
OutputDebugString(ls_InfoLog);
}
}
#else
#define _printProgramInfoLog(foo)
#endif
#define ATOM_EDIT 0xC018
#define ATOM_STATIC 0xC019
#include "..\..\hgplus\obliterator\syncprototype\syncprototype\timeline.h"
#pragma code_seg(".main")
void _cdecl main()
{
#ifndef WINDOWED
ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);
HDC hDC = GetDC(CreateWindowExA(0, (LPCSTR)ATOM_STATIC, 0, WS_POPUP | WS_VISIBLE | WS_MAXIMIZE, 0, 0, 0, 0, 0, 0, 0, 0));
#else
HDC hDC = GetDC(CreateWindowExA(0, (LPCSTR)ATOM_EDIT, 0, WS_EX_APPWINDOW | WS_VISIBLE | WS_SYSMENU, 0, 0, SCREENWIDTH + 16, SCREENHEIGHT + 39, 0, 0, 0, 0));
#endif
SetPixelFormat(hDC, ChoosePixelFormat(hDC, &pfd), &pfd);
wglMakeCurrent(hDC, wglCreateContext(hDC));
//shaders[0] =
((PFNGLCREATESHADERPROGRAMEXTPROC)wglGetProcAddress(sglCreateShaderProgramEXT))(GL_FRAGMENT_SHADER, mark_fs_0);
mark_fs_0[shaderCountOffset]++;
_printProgramInfoLog(1);
//shaders[1] =
((PFNGLCREATESHADERPROGRAMEXTPROC)wglGetProcAddress(sglCreateShaderProgramEXT))(GL_FRAGMENT_SHADER, mark_fs_0);
mark_fs_0[shaderCountOffset]++;
_printProgramInfoLog(2);
//shaders[2] =
((PFNGLCREATESHADERPROGRAMEXTPROC)wglGetProcAddress(sglCreateShaderProgramEXT))(GL_FRAGMENT_SHADER, mark_fs_0);
mark_fs_0[shaderCountOffset]++;
_printProgramInfoLog(3);
ShowCursor(FALSE);
CreateTimeline();
InitSound();
do
{
UpdateTimeline();
get_Sample();
int Sample = MMTime.u.sample - gCurSceneStart;
int SceneEnd = g_SceneLength[gCurScene] * SAMPLES_PER_TICK * 8;//samples per tick
lf_Time = (float)Sample / (float)SceneEnd;
//auto program = shaders[g_SceneShader[gCurScene]];
auto program = 1 + g_SceneShader[gCurScene];
((PFNGLUSEPROGRAMPROC)wglGetProcAddress(sglUseProgram))(program);
((PFNGLUNIFORM4FPROC)wglGetProcAddress(sglUniform4f))(0, gCurScene, lf_Time, SCREENHEIGHT, ASPECTOFFSET);
glRecti(-1, -1, 1, 1);
SwapBuffers(hDC);
if (Sample > SceneEnd)
{
gCurSceneStart += SceneEnd;
gCurScene++;
}
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
} while (MMTime.u.sample < MAX_SAMPLES && !GetAsyncKeyState(VK_ESCAPE));
ExitProcess(0);
}

605
ev14-4k/project/mark.fs Normal file
View File

@@ -0,0 +1,605 @@
const int shader= 0;
@D
//#version 430
@@
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
@D
/////////////////////////////////////////////////////////////////////
//Debugzeug fuer Kamerasteuerung
if( true )
{
p.x= gl_ModelViewMatrix[0][0];
p.y= gl_ModelViewMatrix[0][1];
p.z= gl_ModelViewMatrix[0][2];
float a1= gl_ModelViewMatrix[1][1];
float c1,s1;
//vec3 q1= vec3((Z.xy - 0.5), 0.6);
float ScreenHeight = Y.w;
float AspectOffset = 1280.0 / 720.0 * 0.5 - 0.5; //= 0.445;
vec3 q1 = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
q1.x -= Y.w;
c1 = cos(a1); s1 = sin(a1);
rayDir.y = c1 * q1.y - s1 * q1.z;
rayDir.x= q1.x;
rayDir.z = s1 * q1.y + c1 * q1.z;
a1= gl_ModelViewMatrix[1][0];
q1=rayDir;
c1 = cos(a1); s1 = sin(a1);
rayDir.x = c1 * q1.x + s1 * q1.z;
rayDir.z = -s1 * q1.x + c1 * q1.z;
}
//Ende Debugzeug fuer Kamerasteuerung
/////////////////////////////////////////////////////////////////////
@@
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

605
ev14-4k/project/mark.fs_0 Normal file
View File

@@ -0,0 +1,605 @@
const int shader= 0;
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

View File

@@ -0,0 +1,605 @@
const int shader= 0;
//#version 430
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
/////////////////////////////////////////////////////////////////////
//Debugzeug fuer Kamerasteuerung
if( true )
{
p.x= gl_ModelViewMatrix[0][0];
p.y= gl_ModelViewMatrix[0][1];
p.z= gl_ModelViewMatrix[0][2];
float a1= gl_ModelViewMatrix[1][1];
float c1,s1;
//vec3 q1= vec3((Z.xy - 0.5), 0.6);
float ScreenHeight = Y.w;
float AspectOffset = 1280.0 / 720.0 * 0.5 - 0.5; //= 0.445;
vec3 q1 = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
q1.x -= Y.w;
c1 = cos(a1); s1 = sin(a1);
rayDir.y = c1 * q1.y - s1 * q1.z;
rayDir.x= q1.x;
rayDir.z = s1 * q1.y + c1 * q1.z;
a1= gl_ModelViewMatrix[1][0];
q1=rayDir;
c1 = cos(a1); s1 = sin(a1);
rayDir.x = c1 * q1.x + s1 * q1.z;
rayDir.z = -s1 * q1.x + c1 * q1.z;
}
//Ende Debugzeug fuer Kamerasteuerung
/////////////////////////////////////////////////////////////////////
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

605
ev14-4k/project/mark.fs_1 Normal file
View File

@@ -0,0 +1,605 @@
const int shader= 0;
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

View File

@@ -0,0 +1,605 @@
const int shader= 0;
//#version 430
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
/////////////////////////////////////////////////////////////////////
//Debugzeug fuer Kamerasteuerung
if( true )
{
p.x= gl_ModelViewMatrix[0][0];
p.y= gl_ModelViewMatrix[0][1];
p.z= gl_ModelViewMatrix[0][2];
float a1= gl_ModelViewMatrix[1][1];
float c1,s1;
//vec3 q1= vec3((Z.xy - 0.5), 0.6);
float ScreenHeight = Y.w;
float AspectOffset = 1280.0 / 720.0 * 0.5 - 0.5; //= 0.445;
vec3 q1 = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
q1.x -= Y.w;
c1 = cos(a1); s1 = sin(a1);
rayDir.y = c1 * q1.y - s1 * q1.z;
rayDir.x= q1.x;
rayDir.z = s1 * q1.y + c1 * q1.z;
a1= gl_ModelViewMatrix[1][0];
q1=rayDir;
c1 = cos(a1); s1 = sin(a1);
rayDir.x = c1 * q1.x + s1 * q1.z;
rayDir.z = -s1 * q1.x + c1 * q1.z;
}
//Ende Debugzeug fuer Kamerasteuerung
/////////////////////////////////////////////////////////////////////
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

605
ev14-4k/project/mark.fs_2 Normal file
View File

@@ -0,0 +1,605 @@
const int shader= 0;
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

View File

@@ -0,0 +1,605 @@
const int shader= 0;
//#version 430
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
/////////////////////////////////////////////////////////////////////
//Debugzeug fuer Kamerasteuerung
if( true )
{
p.x= gl_ModelViewMatrix[0][0];
p.y= gl_ModelViewMatrix[0][1];
p.z= gl_ModelViewMatrix[0][2];
float a1= gl_ModelViewMatrix[1][1];
float c1,s1;
//vec3 q1= vec3((Z.xy - 0.5), 0.6);
float ScreenHeight = Y.w;
float AspectOffset = 1280.0 / 720.0 * 0.5 - 0.5; //= 0.445;
vec3 q1 = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
q1.x -= Y.w;
c1 = cos(a1); s1 = sin(a1);
rayDir.y = c1 * q1.y - s1 * q1.z;
rayDir.x= q1.x;
rayDir.z = s1 * q1.y + c1 * q1.z;
a1= gl_ModelViewMatrix[1][0];
q1=rayDir;
c1 = cos(a1); s1 = sin(a1);
rayDir.x = c1 * q1.x + s1 * q1.z;
rayDir.z = -s1 * q1.x + c1 * q1.z;
}
//Ende Debugzeug fuer Kamerasteuerung
/////////////////////////////////////////////////////////////////////
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

605
ev14-4k/project/mark.fs_3 Normal file
View File

@@ -0,0 +1,605 @@
const int shader= 0;
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

View File

@@ -0,0 +1,605 @@
const int shader= 0;
//#version 430
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.0, 0.4, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.4,0.1,0.0 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurTime= Y.y;
CurScene= Y.x;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
rayDir.x -= Y.w;
float vignette = 1.0 - length(rayDir.xy / vec2(2.6,2.));
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
/////////////////////////////////////////////////////////////////////
//Debugzeug fuer Kamerasteuerung
if( true )
{
p.x= gl_ModelViewMatrix[0][0];
p.y= gl_ModelViewMatrix[0][1];
p.z= gl_ModelViewMatrix[0][2];
float a1= gl_ModelViewMatrix[1][1];
float c1,s1;
//vec3 q1= vec3((Z.xy - 0.5), 0.6);
float ScreenHeight = Y.w;
float AspectOffset = 1280.0 / 720.0 * 0.5 - 0.5; //= 0.445;
vec3 q1 = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
q1.x -= Y.w;
c1 = cos(a1); s1 = sin(a1);
rayDir.y = c1 * q1.y - s1 * q1.z;
rayDir.x= q1.x;
rayDir.z = s1 * q1.y + c1 * q1.z;
a1= gl_ModelViewMatrix[1][0];
q1=rayDir;
c1 = cos(a1); s1 = sin(a1);
rayDir.x = c1 * q1.x + s1 * q1.z;
rayDir.z = -s1 * q1.x + c1 * q1.z;
}
//Ende Debugzeug fuer Kamerasteuerung
/////////////////////////////////////////////////////////////////////
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= normalize(vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) ));
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 8.0;
for (z=1.0;y>0.;y--)
{
z-=.5*(y-f(p+n*y))/exp2(y);
}
CurColor*= z * lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
gl_FragColor.xyz = smoothstep(15.8, 15.79, Y.x + Y.y) * vignette *
min(1.0,sin(Y.y * pi2 / 2.0)*15.8) //fade
* (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy)));
}

608
ev14-4k/project/mark1.fs Normal file
View File

@@ -0,0 +1,608 @@
const int shader= 0 ;
@D
//#version 430
@@
// Parameters from our host
// x: Scene
// y: Zeit
// z: Breite
// w: Hoehe
uniform vec4 Y;
// Position of the fragment
//vec2 Z;
// All data of our world
float cFac, CurTime, CurTime2, CurScene, CurStep, pi2= 6.28319;
int m;
vec2 CurNormal;
vec3 cRes, CurColor = vec3(0.), RayStep = vec3(0.);
vec3 LightColor= vec3( 8., 4., 2.0);
vec3 BackColor= vec3( 0.7, 1.0, 1.2);
vec4 HitMaterial;
vec2 rotate(vec2 v,float y)
{
return cos(y)*v+sin(y)*vec2(-v.y,v.x);
}
//repeat around y axis w times
//void rp(inout vec3 p, float trans, float w)
float repeatr(inout vec2 v,float x, float y)
{
float a= atan(v.y,v.x);
float z=mod(a,y)-y*.5;
v=(length(v))*vec2(cos(z),sin(z));
v.x-=x;
return a-z;
}
void repeat( inout float w, float y )
{
w= mod( w - y*.5, y ) - y*.5;
}
/*void repeate( inout float w, float y, float z )
{
w= max( abs(w)-z, mod( w - y*.5, y ) - y*.5);
}*/
float row( float w, float y)
{
return floor( ( w - y*.5 )/ y );
}
//radius of the torus/ radius of the ring
float torus(vec3 p,float f)
{
return length(vec2(length(p.xz) - f,p.y));
}
/*float signedDistToBox( vec3 p, vec3 b )
{
vec3 di = abs(p) - b;
float mc = maxcomp(di);
return mc<0.0 ? mc : length(max(di,0.0));
}*/
float CBox( in vec3 p, in vec3 box, float rad )
{
return length( max( abs(p) - box + vec3(rad), 0.0 ) ) - rad;
}
/*float EndlessBar( vec2 p, float y, float z )
{
return length( max( abs(p) - vec2(y) + vec2(z), 0.0 ) ) - z;
}*/
/*float noise3D( vec3 p )
{
return fract( sin( p.x * 151.0 + p.y * 33.0 + p.z ) * 11.0 );
}
float smoothnoise(vec3 p)
{
vec2 e = vec2(1.0, 0.0);
vec3 o= smoothstep(0.0,1.0,fract( p ));
p= floor( p );
vec4 n= mix(
vec4(
noise3D( p+e.yyy),//n000,
noise3D( p+e.xyy),//n100,
noise3D( p+e.yxy),//n010,
noise3D( p+e.xxy)),//n110),
vec4(
noise3D( p+e.yyx),//n001,
noise3D( p+e.xyx),//n101,
noise3D( p+e.yxx),//n011,
noise3D( p+e.xxx)),//n111),
o.z);
e = mix(n.xy, n.zw, o.y);
return mix(e.x, e.y, o.x);
}*/
float plasm(float x, float a, float b,float c)
{
return sin(x+a+c*sin(x+b));
}
float smin( float a, float b, float k )
{
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float f0(vec3 p)
{
if( shader == 0 )
{
float d = length(p) - 24.0 - plasm(0.3 * p.x, 8.0 * CurTime, 0.3 * p.y, sin(0.3 *p.z));
if (CurScene == 2.)
{
return 999.;
}
else if (CurScene < 4.)
{
return d;
}
else
{
p.x += sin(4.0 * CurTime2 + 0.2 * p.y);
p.z += sin(0.3 * p.y);
return 0.8 * smin (max(p.y, length (p.xz) - 4.0 - plasm(0.0, 0. + 0.2 * p.y, 0.5 * p.x, 0.3 * p.z) + 11.0 * smoothstep(11.0,-11.0, p.y + 222.0 * CurTime2)),
d,
11.0);
}
}
else if( shader == 1 )
{
vec3 o = p;
o.x += sin(4.0 * CurTime + 0.2 * o.y);
o.z += sin(0.3 * o.y);
p.y -= 11. - 6.0 * smoothstep( -22.0, 0.0, p.x);
repeat(p.y, 88.);
float d = p.x;
p.x -= 77.0 * CurTime;
p.yz = rotate(p.yz, cos((0.3 * d )) + 4.0 * CurTime * cos(77.0 * row(p.x, 6.)));
repeat(p.x, 6.);
p.y -= 1.0;
return smin( max( length(p) - 1.0, d),
length (o.xz) - 6.0 - plasm(0.0, 0. + 0.2 * o.y, 0.5 * o.x, 0.3 * o.z),
4.0);
}
else
{
float d = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
d = plasm(16.0 * CurTime, 0.3 * p.y, 0.3 * p.z, sin(0.3 *p.x)) * smoothstep( 34.0, 33.0, d);
if( plasm(16.0, 0.3, row(p.z, 99.), row(p.x, 77.) - (CurTime-CurTime2)) > 0.8)
{
d += 8.0;
}
repeat(p.z, 99.);
repeat(p.x, 77.);
return torus(p, 22.0) - 6.0 + d;
}
}
float f1(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = -o.y;
o.y += 83.0;
return max( d, length(o) - 88.);
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float e = length(p.xz) - 22.0;
p.z -= 44.0;
float d = length( max(vec2(abs(p.y)- 2.7, 58.0 - length(p.xz)), 0.0)) - 2.0;
return max(d, e);
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
//repeat(p.x, 77.);
p.y -= 4.0;
float d = CBox(p, vec3(33.0, 7.0, 33.0), 3.0);
repeatr(p.zx, 11.0, pi2 / 2.0);
p.y -= 11.0;
return smin( d, CBox(p, vec3(22.0, 22.0, 8.0), 8.), 8.0);
}
}
float f2(vec3 p)
{
//p.xz = rotate(p.xz, p.y/8. );
//repeatr(p.xz, 8.0, pi2 / 3.0);
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
p.xz = rotate(p.xz, 2.0 * CurTime2);
repeatr(p.xz, 44.0, pi2 / 5.0);
p.y += 77. - CurTime2 * 22.0;
p.xy = rotate(p.xy, -CurTime2);
vec3 o = p;
o.y-= 17.0;
o.x-= 38.0;
o.xy = rotate(o.xy, 0.4);
float d = max(max(o.y, length(o) - 31.0), min(abs(o.z), (-o.y)) - 2.0);
p.z = abs(p.z) - 8.0;
return min( d, CBox( p, vec3(33.,8.0 - 0.1 * p.x ,4.), 2.));
}
else if( shader == 1 )
{
p.xz = rotate(p.xz, 11.0 * sin(99.0 *row(p.y, 22.)) + 4.0 * CurTime * cos(66.0 * row(p.y, 22.)));
repeat(p.y, 22.);
float d = length(p.xz) - 22.0;
p.z -= 12.0;
float e = length(p.xz) - 28.0;
repeatr(p.xz, 0.0, pi2 / 22.0);
return 0.6 * max( length(p.y) - 5.0,
smin(
smin( length(d) - 0.5, length(e) - 0.5, 4.0),
max( length(p.yz) - 0.5, max(e + 2.0, 2.0 - d)),
4.0));
}
else
{
repeat(p.z, 99.);
float f = p.x;
p.x -= 77. * smoothstep( 0.0, 0.6, CurTime2) - 77. * smoothstep( 0.6, 0.9, CurTime2);
vec3 o = p;
p.y -= 22. * smoothstep( 0.5, 0.7, CurTime2) - 22. * smoothstep( 0.9, 1.0, CurTime2);
p.y -= 55.0;
o.y -= 99.0;
p.z = 11.0 - length(p.z);
float d = CBox(o, vec3(22.0, 11.0, 33.0), 2.);
o.z = 22.0 - length(o.z);
float e = CBox(o, vec3(999.0, 4.0, 7.0), 2.);
o.x = f;
repeat(o.x, 11.);
return min( max( e, -length(o.xz) + 4.0 ),
smin( CBox(p, vec3(6.0, 44.0, 6.0), 2.), d, 8.0));
}
}
float f3(vec3 p)
{
if( shader == 0 )
{
if (CurScene < 2.)
{
return 999.;
}
float d = p.y + 77.0;
repeat(p.y, 11.0);
return max( max( length(p.y) - 2.0, d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max( max( abs( p.y - 2.0), d), length(CBox(p, vec3(22.,22.,22.), 3.)) - 2.0);
return max(p.y + 12., 24.0 - length(p.z) );
}
else if( shader == 1 )
{
p.y -= 11.;
repeat(p.y, 88.);
float d = p.x + 44.0;
p.yz = rotate(p.yz, 11.0 * sin(99.0 *row(p.x, 18.)) + 4.0 * CurTime * cos(77.0 * row(p.x, 18.)));
repeat(p.x, 18.0);
return max( d, max(CBox(p, vec3(5.,22.,22.), 2.), -CBox(p, vec3(11.,11.,11.), 4.) ));
}
else
{
repeat(p.z, 99.);
p.x -= 77. * smoothstep( 0.0, 0.6 , CurTime2);
repeat(p.x, 77.);
float d = torus(p, 22.0) - 9.0;
p.y -= 7.0;
d = smin( CBox(p, vec3(33.0, 7.0, 33.0), 2.), d, 8.);
p.y += 11.0;
return min( p.y + 10.0 + length( 4. - mod(p.x, 8.)) / 4.0, max( CBox(p, vec3(37.0, 6.0, 37.0), 3.), -d));
}
}
float f(vec3 p)
{
//if( shader == 0 )
return min( min( min( f0(p), f1(p) ), f2(p) ), f3(p) );
//else if ( shader == 1 )
// return .0; //min(min(min(f4(p),f5(p)),f6(p)),f7(p));
//else if ( shader == 2 )
// return .0; //min(min(min(f8(p),f9(p)),f10(p)),f11(p));
//else if ( shader == 3 )
// return .0; //min( min(f12(p),f13(p)),f14(p));
}
void mat(vec3 p)
{
float z= 0.5;
if( z > f0(p) )
{
HitMaterial = vec4(-1.2, 0.5, 0., 1.6);
CurColor = vec3(0.5,.0,.1 );
CurStep= .3;
}
if( z > f1(p) )
{
z= f1(p);
HitMaterial = vec4(-2.0, 0.8, 0., 4.);
CurColor = vec3(0.2,0.2,0.2 );
CurStep= .8;
}
if( z > f2(p) )
{
z= f3(p);
HitMaterial = vec4(-2.0, 0.8, 0.5, 1.2);
CurColor = vec3(1.1,0.8,0.7);
CurStep= .1;
}
if( z > f3(p) )
{
z= f2(p);
HitMaterial = vec4(-1.0, -.3, 0.5, 0.9);
CurColor = vec3(.2,.2,.2);
CurStep= .05;
CurNormal.y= 0.;
CurNormal.x= 0.;
//m=2;
}
}
void ToRes(vec3 Color, float Factor)
{
cRes+= Color * cFac;
cFac*= Factor;
}
vec3 lightSphere(vec3 normal, vec3 color, vec2 desc)
{
return smoothstep(desc.x, desc.y, dot(vec3( 0.7, 0.7, 0.0),normal)) * color;
}
void main()
{
//Z = (gl_FragCoord.xy / Y.zw) * vec2(Y.z/Y.w, 1);
CurScene= Y.x;
CurTime= Y.y;
CurTime2= CurTime * CurTime;
// Get the look direction for the current pixel (always look forwards)
vec3 rayDir = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
float vignette = 1.2 - length(rayDir.xy) * 0.5;
rayDir.x -= Y.w;
//Kamera sitzt an dieser Position
vec3 p = vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
if( CurScene-- < 1.0 )
{
//p= vec3( 99.0, 55.0, 44.0) * (1.0 - CurTime * 0.3);
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 2.6 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -11.0, CurTime * 33.0);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, -99.0 * (1.0 - CurTime * 1.2), -88.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, 44.0 * (1.0 - CurTime * 0.4), -99.);
rayDir.yz= rotate( rayDir.yz, 0.5 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 11.0, 66.* (1.0 - CurTime * 0.4), -33.);
rayDir.yz= rotate( rayDir.yz, 1.2 );
//rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = CurTime;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -66.0, -88.* (0.6 + CurTime * 0.3), 66.);
rayDir.yz= rotate( rayDir.yz, -0.4 );
rayDir.xz= rotate( rayDir.xz, 4.5 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -33.0, -99.* (0.5 + CurTime), -33.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 5.3 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( 0.0, -99.* (0.5 + CurTime * 1.5), -6.);
rayDir.yz= rotate( rayDir.yz, -1.0 );
//CurTime2 = 0.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 1
p= vec3(-88.* (1. + CurTime * 1.), 10.0, -4.);
rayDir.yz= rotate( rayDir.yz, -0.3 );
rayDir.xz= rotate( rayDir.xz, 1. - CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-88.* (1. - CurTime * 0.4), 13.0, 4.);
rayDir.yz= rotate( rayDir.yz, 0.3 );
rayDir.xz= rotate( rayDir.xz, 3. + CurTime );
}
else if( CurScene-- < 1.0 )
{
p= vec3(-33.* (1. - CurTime * 0.6), 103.0, -6.);
rayDir.yz= rotate( rayDir.yz, 0.6 );
rayDir.xz= rotate( rayDir.xz, 6. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
p= vec3( -8.0, -99.* (CurTime * 1.8), 6.);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 3. );
CurTime2 *= 2.0;
}
else if( CurScene-- < 1.0 )
{
////////////// Shader 2
p= vec3( -88., 22.0, -99.0 * (1.0 - CurTime * 1.2));
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 5.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( 166.0, 44.0, 99.0 * (1.0 - CurTime * 3.3));
rayDir.yz= rotate( rayDir.yz, 0.4 );
rayDir.xz= rotate( rayDir.xz, 1.0 - CurTime );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 3.3), 88.0, -44.0);
rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 2.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
else if( CurScene-- < 1.0 )
{
p= vec3( -99.0 * (1.0 - CurTime * 0.8 ), 12.0, 99.0);
//rayDir.yz= rotate( rayDir.yz, 0.6 + CurTime );
rayDir.xz= rotate( rayDir.xz, 4.5 );
CurTime = CurTime * 8.0 + 0.6;
CurTime2 = mod( CurTime, 1.0);
}
CurScene= Y.x;
@D
/////////////////////////////////////////////////////////////////////
//Debugzeug fuer Kamerasteuerung
if( true )
{
p.x= gl_ModelViewMatrix[0][0];
p.y= gl_ModelViewMatrix[0][1];
p.z= gl_ModelViewMatrix[0][2];
float a1= gl_ModelViewMatrix[1][1];
float c1,s1;
//vec3 q1= vec3((Z.xy - 0.5), 0.6);
float ScreenHeight = Y.w;
float AspectOffset = 1280.0 / 720.0 * 0.5 - 0.5; //= 0.445;
vec3 q1 = vec3((gl_FragCoord.xy / Y.z - 0.5), 0.6);
q1.x -= Y.w;
c1 = cos(a1); s1 = sin(a1);
rayDir.y = c1 * q1.y - s1 * q1.z;
rayDir.x= q1.x;
rayDir.z = s1 * q1.y + c1 * q1.z;
a1= gl_ModelViewMatrix[1][0];
q1=rayDir;
c1 = cos(a1); s1 = sin(a1);
rayDir.x = c1 * q1.x + s1 * q1.z;
rayDir.z = -s1 * q1.x + c1 * q1.z;
}
//Ende Debugzeug fuer Kamerasteuerung
/////////////////////////////////////////////////////////////////////
@@
rayDir = normalize(rayDir);
cRes= vec3( .0,.0,.0 );
cFac=1.0;
//float t=smoothnoise( rayDir*666.0 )*0.1,y,z;
//float t= 0.5 * plasm(999. * rayDir.x, 999. * rayDir.z, 999. * rayDir.y,999. * rayDir.z),y,z;
float t= 0.0,y,z;
m=0;
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
while(m++<2)
{
//bis zu einer Oberflaeche steppen
//for (CurStep=1.0;t<250.0 && CurStep>t*.003;t+=0.01+max(0.0, CurStep),RayStep=rayDir*t )
for (CurStep=1.0;t<999.0 && CurStep>t*.0005;t+=CurStep,RayStep=rayDir*t )
{
CurStep = f(p+RayStep);
}
vec3 NextPos = p+RayStep;
//Startpunkt und Richtung fuer reflektierten Strahl;
p= NextPos;
CurNormal = vec2(0.04, 0.0);
vec3 n= vec3( f(p + CurNormal.xyy) - f(p - CurNormal.xyy), f(p + CurNormal.yxy) - f(p - CurNormal.yxy), f(p + CurNormal.yyx) - f(p - CurNormal.yyx) );
n= normalize(n);
//CurStep ab hier == Reflektion !!!
mat(p);
if( t > 999.0 )
{
if( m < 2)
{
HitMaterial = vec4(-3.0, 8.0, 0.98, 1.0);
}
break;
}
rayDir= reflect( rayDir, n );
//float ao(vec3 p, vec3 n, float d, float i) {
y= 6.0;
for (z=1.0;y>0.;y--)
{
z-=(y*.5-f(p+n*y*.5))/exp2(y);
}
CurColor*= z;
CurColor*= lightSphere(rayDir, BackColor, HitMaterial.xy);
cRes+= cFac*CurColor;//*(1.0-Reflect);
cFac*= CurStep;// Reflect * (1.0-t/tmax);
t= 0.5;
RayStep=rayDir*t;
}
CurColor = smoothstep(15.8, 15.79, Y.x + Y.y) * min(1.0, vignette * (cRes + cFac*
( lightSphere(rayDir, LightColor, HitMaterial.zw) +
lightSphere(rayDir, BackColor, HitMaterial.xy))));
gl_FragColor.xyz = smoothstep(0.0, 1.0, CurColor);
}

View File

@@ -0,0 +1,328 @@
/* File generated with Shader Minifier 1.1.1
* http://www.ctrl-alt-test.fr
*/
#ifndef MARK_SMALL_H_
# define MARK_SMALL_H_
# define U_Y "v"
char mark_fs_0[] = ""
"const int z=0;"
"uniform vec4 v;"
"float f,y,x,e,m,s=6.28319;"
"int i;"
"vec2 r;"
"vec3 l,c=vec3(0.),w=vec3(0.),d=vec3(8.,4.,2.),t=vec3(.7,1.,1.2);"
"vec4 n;"
"vec2 h(vec2 y,float i)"
"{"
"return cos(i)*y+sin(i)*vec2(-y.y,y.x);"
"}"
"float h(inout vec2 z,float v,float y)"
"{"
"float e=atan(z.y,z.x),x=mod(e,y)-y*.5;"
"z=length(z)*vec2(cos(x),sin(x));"
"z.x-=v;"
"return e-x;"
"}"
"void p(inout float z,float y)"
"{"
"z=mod(z-y*.5,y)-y*.5;"
"}"
"float o(float z,float y)"
"{"
"return floor((z-y*.5)/y);"
"}"
"float a(vec3 z,float y)"
"{"
"return length(vec2(length(z.xz)-y,z.y));"
"}"
"float a(in vec3 z,in vec3 y,float x)"
"{"
"return length(max(abs(z)-y+vec3(x),0.))-x;"
"}"
"float a(float z,float y,float x,float i)"
"{"
"return sin(z+y+i*sin(z+x));"
"}"
"float o(float y,float z,float x)"
"{"
"float m=clamp(.5+.5*(z-y)/x,0.,1.);"
"return mix(z,y,m)-x*m*(1.-m);"
"}"
"float a(vec3 v)"
"{"
"if(z==0)"
"{"
"float m=length(v)-24.-a(.3*v.x,8.*y,.3*v.y,sin(.3*v.z));"
"if(e==2.)"
"return 999.;"
"else"
" if(e<4.)"
"return m;"
"else"
" return v.x+=sin(4.*x+.2*v.y),v.z+=sin(.3*v.y),.8*o(max(v.y,length(v.xz)-4.-a(0.,.2*v.y,.5*v.x,.3*v.z)+11.*smoothstep(11.,-11.,v.y+222.*x)),m,11.);"
"}"
"else"
" if(z==1)"
"{"
"vec3 i=v;"
"i.x+=sin(4.*y+.2*i.y);"
"i.z+=sin(.3*i.y);"
"v.y-=11.-6.*smoothstep(-22.,0.,v.x);"
"p(v.y,88.);"
"float m=v.x;"
"v.x-=77.*y;"
"v.yz=h(v.yz,cos(.3*m)+4.*y*cos(77.*o(v.x,6.)));"
"p(v.x,6.);"
"v.y-=1.;"
"return o(max(length(v)-1.,m),length(i.xz)-6.-a(0.,.2*i.y,.5*i.x,.3*i.z),4.);"
"}"
"else"
"{"
"float i=v.x;"
"v.x-=77.*smoothstep(0.,.6,x);"
"i=a(16.*y,.3*v.y,.3*v.z,sin(.3*v.x))*smoothstep(34.,33.,i);"
"if(a(16.,.3,o(v.z,99.),o(v.x,77.)-(y-x))>.8)"
"i+=8.;"
"p(v.z,99.);"
"p(v.x,77.);"
"return a(v,22.)-6.+i;"
"}"
"}"
"float h(vec3 v)"
"{"
"if(z==0)"
"{"
"if(e<2.)"
"return 999.;"
"v.xz=h(v.xz,2.*x);"
"h(v.xz,44.,s/5.);"
"v.y+=77.-x*22.;"
"v.xy=h(v.xy,-x);"
"vec3 i=v;"
"i.y-=17.;"
"i.x-=38.;"
"i.xy=h(i.xy,.4);"
"float m=-i.y;"
"i.y+=83.;"
"return max(m,length(i)-88.);"
"}"
"else"
" if(z==1)"
"{"
"v.xz=h(v.xz,11.*sin(99.*o(v.y,22.))+4.*y*cos(66.*o(v.y,22.)));"
"p(v.y,22.);"
"float m=length(v.xz)-22.;"
"v.z-=44.;"
"float i=length(max(vec2(abs(v.y)-2.7,58.-length(v.xz)),0.))-2.;"
"return max(i,m);"
"}"
"else"
"{"
"p(v.z,99.);"
"v.x-=77.*smoothstep(0.,.6,x)-77.*smoothstep(.6,.9,x);"
"v.y-=22.*smoothstep(.5,.7,x)-22.*smoothstep(.9,1.,x);"
"v.y-=4.;"
"float i=a(v,vec3(33.,7.,33.),3.);"
"h(v.zx,11.,s/2.);"
"v.y-=11.;"
"return o(i,a(v,vec3(22.,22.,8.),8.),8.);"
"}"
"}"
"float o(vec3 v)"
"{"
"if(z==0)"
"{"
"if(e<2.)"
"return 999.;"
"v.xz=h(v.xz,2.*x);"
"h(v.xz,44.,s/5.);"
"v.y+=77.-x*22.;"
"v.xy=h(v.xy,-x);"
"vec3 i=v;"
"i.y-=17.;"
"i.x-=38.;"
"i.xy=h(i.xy,.4);"
"float m=max(max(i.y,length(i)-31.),min(abs(i.z),-i.y)-2.);"
"v.z=abs(v.z)-8.;"
"return min(m,a(v,vec3(33.,8.-.1*v.x,4.),2.));"
"}"
"else"
" if(z==1)"
"{"
"v.xz=h(v.xz,11.*sin(99.*o(v.y,22.))+4.*y*cos(66.*o(v.y,22.)));"
"p(v.y,22.);"
"float i=length(v.xz)-22.;"
"v.z-=12.;"
"float m=length(v.xz)-28.;"
"h(v.xz,0.,s/22.);"
"return.6*max(length(v.y)-5.,o(o(length(i)-.5,length(m)-.5,4.),max(length(v.yz)-.5,max(m+2.,2.-i)),4.));"
"}"
"else"
"{"
"p(v.z,99.);"
"float m=v.x;"
"v.x-=77.*smoothstep(0.,.6,x)-77.*smoothstep(.6,.9,x);"
"vec3 i=v;"
"v.y-=22.*smoothstep(.5,.7,x)-22.*smoothstep(.9,1.,x);"
"v.y-=55.;"
"i.y-=99.;"
"v.z=11.-length(v.z);"
"float f=a(i,vec3(22.,11.,33.),2.);"
"i.z=22.-length(i.z);"
"float l=a(i,vec3(999.,4.,7.),2.);"
"i.x=m;"
"p(i.x,11.);"
"return min(max(l,-length(i.xz)+4.),o(a(v,vec3(6.,44.,6.),2.),f,8.));"
"}"
"}"
"float p(vec3 v)"
"{"
"if(z==0)"
"{"
"if(e<2.)"
"return 999.;"
"float m=v.y+77.;"
"p(v.y,11.);"
"return max(max(length(v.y)-2.,m),length(a(v,vec3(22.,22.,22.),3.))-2.);"
"return max(max(abs(v.y-2.),m),length(a(v,vec3(22.,22.,22.),3.))-2.);"
"return max(v.y+12.,24.-length(v.z));"
"}"
"else"
" if(z==1)"
"{"
"v.y-=11.;"
"p(v.y,88.);"
"float i=v.x+44.;"
"v.yz=h(v.yz,11.*sin(99.*o(v.x,18.))+4.*y*cos(77.*o(v.x,18.)));"
"p(v.x,18.);"
"return max(i,max(a(v,vec3(5.,22.,22.),2.),-a(v,vec3(11.,11.,11.),4.)));"
"}"
"else"
"{"
"p(v.z,99.);"
"v.x-=77.*smoothstep(0.,.6,x);"
"p(v.x,77.);"
"float i=a(v,22.)-9.;"
"v.y-=7.;"
"i=o(a(v,vec3(33.,7.,33.),2.),i,8.);"
"v.y+=11.;"
"return min(v.y+10.+length(4.-mod(v.x,8.))/4.,max(a(v,vec3(37.,6.,37.),3.),-i));"
"}"
"}"
"float g(vec3 v)"
"{"
"return min(min(min(a(v),h(v)),o(v)),p(v));"
"}"
"void u(vec3 v)"
"{"
"float z=.5;"
"if(z>a(v))"
"n=vec4(-1.,.4,0.,1.6),c=vec3(.5,0.,.1),m=.3;"
"if(z>h(v))"
"z=h(v),n=vec4(-2.,.8,0.,4.),c=vec3(.4,.1,0.),m=.8;"
"if(z>o(v))"
"z=p(v),n=vec4(-2.,.8,.5,1.2),c=vec3(1.1,.8,.7),m=.1;"
"if(z>p(v))"
"z=o(v),n=vec4(-1.,-.3,.5,.9),c=vec3(.2,.2,.2),m=.05,r.y=0.,r.x=0.;"
"}"
"void g(vec3 y,float v)"
"{"
"l+=y*f,f*=v;"
"}"
"vec3 g(vec3 y,vec3 z,vec2 v)"
"{"
"return smoothstep(v.x,v.y,dot(vec3(.7,.7,0.),y))*z;"
"}"
"void main()"
"{"
"y=v.y;"
"e=v.x;"
"x=y*y;"
"vec3 z=vec3(gl_FragCoord.xy/v.z-.5,.6);"
"z.x-=v.w;"
"float o=1.-length(z.xy/vec2(2.6,2.));"
"vec3 p=vec3(99.,55.,44.)*(1.-y*.3);"
"if(e--<1.)"
"z.yz=h(z.yz,.4),z.xz=h(z.xz,2.6);"
"else"
" if(e--<1.)"
"p=vec3(-33.,-11.,y*33.),z.yz=h(z.yz,-.4),z.xz=h(z.xz,4.5);"
"else"
" if(e--<1.)"
"p=vec3(11.,-99.*(1.-y*1.2),-88.),z.yz=h(z.yz,.5),x=0.;"
"else"
" if(e--<1.)"
"p=vec3(-33.,44.*(1.-y*.4),-99.),z.yz=h(z.yz,.5);"
"else"
" if(e--<1.)"
"p=vec3(11.,66.*(1.-y*.4),-33.),z.yz=h(z.yz,1.2);"
"else"
" if(e--<1.)"
"p=vec3(-66.,-88.*(.6+y*.3),66.),z.yz=h(z.yz,-.4),z.xz=h(z.xz,4.5);"
"else"
" if(e--<1.)"
"p=vec3(-33.,-99.*(.5+y),-33.),z.yz=h(z.yz,-.3),z.xz=h(z.xz,5.3);"
"else"
" if(e--<1.)"
"p=vec3(0.,-99.*(.5+y*1.5),-6.),z.yz=h(z.yz,-1.);"
"else"
" if(e--<1.)"
"p=vec3(-88.*(1.+y),10.,-4.),z.yz=h(z.yz,-.3),z.xz=h(z.xz,1.-y);"
"else"
" if(e--<1.)"
"p=vec3(-88.*(1.-y*.4),13.,4.),z.yz=h(z.yz,.3),z.xz=h(z.xz,3.+y);"
"else"
" if(e--<1.)"
"p=vec3(-33.*(1.-y*.6),103.,-6.),z.yz=h(z.yz,.6),z.xz=h(z.xz,6.),x*=2.;"
"else"
" if(e--<1.)"
"p=vec3(-8.,-99.*(y*1.8),6.),z.yz=h(z.yz,.6+y),z.xz=h(z.xz,3.),x*=2.;"
"else"
" if(e--<1.)"
"p=vec3(-88.,22.,-99.*(1.-y*1.2)),z.xz=h(z.xz,5.5),y=y*8.+.6,x=mod(y,1.);"
"else"
" if(e--<1.)"
"p=vec3(166.,44.,99.*(1.-y*3.3)),z.yz=h(z.yz,.4),z.xz=h(z.xz,1.-y),y=y*8.+.6,x=mod(y,1.);"
"else"
" if(e--<1.)"
"p=vec3(-99.*(1.-y*3.3),88.,-44.),z.yz=h(z.yz,.6+y),z.xz=h(z.xz,2.5),y=y*8.+.6,x=mod(y,1.);"
"else"
" if(e--<1.)"
"p=vec3(-99.*(1.-y*.8),12.,99.),z.xz=h(z.xz,4.5),y=y*8.+.6,x=mod(y,1.);"
"e=v.x;"
"z=normalize(z);"
"l=vec3(0.,0.,0.);"
"f=1.;"
"float a=0.,b,k;"
"i=0;"
"n=vec4(-3.,8.,.98,1.);"
"while(i++<2)"
"{"
"for(m=1.;a<999.&&m>a*.0005;a+=m,w=z*a)"
"m=g(p+w);"
"vec3 F=p+w;"
"p=F;"
"r=vec2(.04,0.);"
"vec3 C=normalize(vec3(g(p+r.xyy)-g(p-r.xyy),g(p+r.yxy)-g(p-r.yxy),g(p+r.yyx)-g(p-r.yyx)));"
"u(p);"
"if(a>999.)"
"{"
"if(i<2)"
"n=vec4(-3.,8.,.98,1.);"
"break;"
"}"
"z=reflect(z,C);"
"b=8.;"
"for(k=1.;b>0.;b--)"
"k-=.5*(b-g(p+C*b))/exp2(b);"
"c*=k*g(z,t,n.xy);"
"l+=f*c;"
"f*=m;"
"a=.5;"
"w=z*a;"
"}"
"gl_FragColor.xyz=smoothstep(15.8,15.79,v.x+v.y)*o*min(1.,sin(v.y*s/2.)*15.8)*(l+f*(g(z,d,n.zw)+g(z,t,n.xy)));"
"}";
#endif // MARK_SMALL_H_

View File

@@ -0,0 +1,2 @@
@shader_minifier -o mark_small.h -v mark.fs_0
@pause

View File

@@ -0,0 +1,10 @@
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\synth.obj
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\shaders.obj
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\main.compress.obj
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\vc120.pdb
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\cl.command.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\cl.read.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\cl.write.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\link.command.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\link.read.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\link.write.1.tlog

View File

@@ -0,0 +1,150 @@
Build started 09.08.2014 11:50:00.
1>Project "E:\blu-flame.org\ev14-4k\project\bp4k.vcxproj" on node 2 (Build target(s)).
1>ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /nologo /W0 /WX- /O1 /Ob2 /Oi /Os /Oy /D WIN32 /D NDEBUG /D _WINDOWS /Gm- /MT /GS- /Gy- /Qpar- /arch:IA32 /fp:fast /Zc:wchar_t /Zc:forScope /GR- /Fo"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Compress (Slow)\\" /Fd"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Compress (Slow)\vc120.pdb" /Gz /TP /analyze- /errorReport:prompt /QIfist main.compress.cpp
1>cl : Command line warning D9035: option 'QIfist' has been deprecated and will be removed in a future release
main.compress.cpp
Link:
E:\blu-flame.org\ev14-4k\project\link.exe /OUT:"E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).exe" /NOLOGO /LIBPATH:"E:\blu-flame.org\ev14-4k\project\\" opengl32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST:NO /PDB:"E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /ENTRY:"main" /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).lib" /MACHINE:X86 /SAFESEH /CRINKLER /COMPMODE:SLOW /ORDERTRIES:4000 /HASHTRIES:300 /UNSAFEIMPORT /TRUNCATEFLOATS:24 /HASHSIZE:200 /REPORT:report.html /RANGE:opengl32 /PROGRESSGUI /TRANSFORM:CALLS 4klang.obj
"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Compress (Slow)\main.compress.obj"
4klang.obj
Crinkler 1.4 (Jan 19 2013) (c) 2005-2013 Aske Simon Christensen & Rune Stubbe
Ignoring unknown argument '/NOLOGO'
Ignoring unknown argument '/MANIFEST:NO'
Ignoring unknown argument '/PDB:E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).pdb'
Ignoring unknown argument '/TLBID:1'
Ignoring unknown argument '/DYNAMICBASE'
Ignoring unknown argument '/NXCOMPAT'
Ignoring unknown argument '/IMPLIB:E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).lib'
Ignoring unknown argument '/MACHINE:X86'
Ignoring unknown argument '/SAFESEH'
Target: E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).exe
Subsystem type: WINDOWS
Large address aware: YES
Compression mode: SLOW
Hash size: 200 MB
Hash tries: 300
Order tries: 4000
Report: report.html
Transforms: CALLS
Replace DLLs: NONE
Range DLLs: opengl32
Loading opengl32.lib...
Loading winmm.lib...
Loading kernel32.lib...
Loading user32.lib...
Loading gdi32.lib...
Loading winspool.lib...
Loading comdlg32.lib...
Loading advapi32.lib...
Loading shell32.lib...
Loading ole32.lib...
Loading oleaut32.lib...
Loading uuid.lib...
Loading odbc32.lib...
Loading odbccp32.lib...
Loading 4klang.obj...
Loading E:\blu-flame.org\ev14-4k\project\obj\bp4k_Compress (Slow)\main.compress.obj...
Loading 4klang.obj...
Linking...
Truncating floats:
Calls transformed: 25
Uncompressed size of code: 2052
Uncompressed size of data: 9209
|-- Estimating models for code ----------------------------|
............................................................ 0m01s
Ideal compressed size: 1172.94
|-- Estimating models for data ----------------------------|
............................................................ 0m26s
Ideal compressed size: 2559.76
Estimated ideal compressed total size: 3732.71
Reordering sections...
Iteration: 1 Size: 3731.64
Iteration: 19 Size: 3730.28
Iteration: 23 Size: 3724.35
Iteration: 30 Size: 3724.04
Iteration: 31 Size: 3723.43
Iteration: 58 Size: 3722.29
Iteration: 97 Size: 3721.69
Iteration: 99 Size: 3721.34
Iteration: 157 Size: 3721.28
Iteration: 224 Size: 3720.42
Iteration: 229 Size: 3720.25
Iteration: 230 Size: 3719.29
Iteration: 236 Size: 3719.00
Iteration: 247 Size: 3718.45
Iteration: 261 Size: 3716.86
Iteration: 318 Size: 3715.59
Iteration: 319 Size: 3713.68
Iteration: 372 Size: 3712.68
Iteration: 373 Size: 3712.53
Iteration: 376 Size: 3710.71
Iteration: 380 Size: 3710.31
Iteration: 393 Size: 3709.78
Iteration: 396 Size: 3708.29
Iteration: 411 Size: 3704.70
Iteration: 412 Size: 3704.66
Iteration: 453 Size: 3703.47
Iteration: 457 Size: 3703.22
Iteration: 492 Size: 3702.84
Iteration: 520 Size: 3702.68
Iteration: 533 Size: 3702.67
Iteration: 584 Size: 3701.96
Iteration: 601 Size: 3701.91
Iteration: 632 Size: 3701.16
Iteration: 675 Size: 3701.10
Iteration: 724 Size: 3700.72
Iteration: 804 Size: 3697.82
Iteration: 814 Size: 3697.53
Iteration: 1007 Size: 3697.04
Iteration: 1048 Size: 3696.85
Iteration: 1050 Size: 3696.68
Iteration: 1255 Size: 3696.56
Iteration: 1320 Size: 3696.47
Iteration: 1353 Size: 3696.34
Iteration: 1373 Size: 3694.63
Iteration: 1382 Size: 3694.30
Iteration: 1403 Size: 3694.06
Iteration: 1671 Size: 3693.95
Iteration: 1719 Size: 3693.90
Iteration: 3896 Size: 3692.60
Time spent: 0m30s
Calls transformed: 25
|-- Reestimating models for code --------------------------|
............................................................ 0m01s
Ideal compressed size: 1142.61
|-- Reestimating models for data --------------------------|
............................................................ 0m18s
Ideal compressed size: 2552.07
Reestimated ideal compressed total size: 3694.68
|-- Optimizing hash table size ----------------------------|
............................................................ 0m22s
Real compressed total size: 3698
Bytes lost to hashing: 3.32
Final file size: 4083
time spent: 1m42s
bp4k.vcxproj -> E:\blu-flame.org\ev14-4k\project\bin\bp4k_Compress (Slow).exe
1>Done Building Project "E:\blu-flame.org\ev14-4k\project\bp4k.vcxproj" (Build target(s)).
Build succeeded.
Time Elapsed 00:01:42.18

View File

@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
Compress (Slow)|Win32|E:\blu-flame.org\ev14-4k\project\|

View File

@@ -0,0 +1,15 @@
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\synth.obj
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\main.compress.obj
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\vc120.pdb
e:\blu-flame.org\ev14-4k\project\4klang.obj
e:\blu-flame.org\ev14-4k\project\bin\bp4k_compress (slow).exe
e:\blu-flame.org\ev14-4k\project\report.html
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\cl.command.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\cl.read.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\cl.write.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\custombuild.command.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\custombuild.read.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\custombuild.write.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\link.command.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\link.read.1.tlog
e:\blu-flame.org\ev14-4k\project\obj\bp4k_compress (slow)\bp4k.tlog\link.write.1.tlog

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,20 @@
Build started 09.08.2014 14:24:49.
1>Project "E:\blu-flame.org\ev14-4k\project\bp4k.vcxproj" on node 2 (Build target(s)).
1>ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDOWS /Gm /EHsc /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Debug\\" /Fd"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Debug\vc120.pdb" /Gz /TP /analyze- /errorReport:prompt main.cpp
main.cpp
Link:
E:\blu-flame.org\ev14-4k\project\link.exe /ERRORREPORT:PROMPT /OUT:"E:\blu-flame.org\ev14-4k\project\bin\bp4k_Debug.exe" /INCREMENTAL /NOLOGO /LIBPATH:"E:\blu-flame.org\ev14-4k\project\\" Gdi32.lib user32.lib opengl32.lib winmm.lib glu32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"E:\blu-flame.org\ev14-4k\project\bin\bp4k_Debug.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /ENTRY:"main" /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\blu-flame.org\ev14-4k\project\bin\bp4k_Debug.lib" /MACHINE:X86 /SAFESEH 4klang.obj
"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Debug\main.obj"
"E:\blu-flame.org\ev14-4k\project\obj\bp4k_Debug\Shaders.obj"
4klang.obj
Crinkler 1.4 (Jan 19 2013) (c) 2005-2013 Aske Simon Christensen & Rune Stubbe
Launching default linker at 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\VC\BIN\LINK.EXE'
bp4k.vcxproj -> E:\blu-flame.org\ev14-4k\project\bin\bp4k_Debug.exe
1>Done Building Project "E:\blu-flame.org\ev14-4k\project\bp4k.vcxproj" (Build target(s)).
Build succeeded.
Time Elapsed 00:00:01.03

View File

@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
Debug|Win32|E:\blu-flame.org\ev14-4k\project\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More