├── .gitignore ├── 01_Random ├── 01_Random │ ├── 01_Chaos.v4p │ ├── 02_Random.v4p │ └── 03_Gaussian.v4p └── 02_Noise │ ├── Noise.v4p │ └── _advanced │ └── VertexNoisePack │ ├── Bubble │ ├── CloudyHillsCubemap2.dds │ ├── bubble help.v4p │ ├── bubble.fx │ └── vnoise-table.fxh │ ├── TentaclePhongDirectional │ ├── TentaclePhongDirectional help.v4p │ ├── TentaclePhongDirectional.fx │ └── vnoise-table.fxh │ ├── VertexNoise │ ├── VertexNoise help.v4p │ ├── VertexNoise.fx │ └── vnoise-table.fxh │ ├── VertexNoiseGoochy │ ├── FireGrade.bmp │ ├── VertexNoiseGoochy help.v4p │ ├── VertexNoiseGoochy.fx │ └── vnoise-table.fxh │ ├── VertexNoisePhongDirectional │ ├── VertexNoisePhongDirectional help.v4p │ ├── VertexNoisePhongDirectional.fx │ └── vnoise-table.fxh │ ├── VertexNoiseReflections │ ├── VertexNoiseReflections help.v4p │ ├── VertexNoiseReflections.fx │ └── vnoise-table.fxh │ ├── VertexNoiseVelvety │ ├── VertexNoiseVelvety help.v4p │ ├── VertexNoiseVelvety.fx │ └── vnoise-table.fxh │ ├── _credits.txt │ └── vBomb │ ├── FireGrade.bmp │ ├── vBomb help.v4p │ ├── vBomb.fx │ └── vnoise-table.fxh ├── 02_Feedback ├── 01_Feedback │ ├── Feedback.v4p │ └── _advanced │ │ └── feedback_machine │ │ ├── feedback_27.v4p │ │ └── subs │ │ ├── anything.v4p │ │ ├── control_frame_14.v4p │ │ ├── control_frame_mouse.v4p │ │ ├── control_frame_output.v4p │ │ └── frame_04.v4p ├── 02_Recursion │ ├── Recursion.v4p │ ├── Recursion3d.v4p │ ├── SSAO3 │ │ ├── Meso_75.dds │ │ ├── SSAO3 (EX9) help.v4p │ │ ├── SSAO3 (EX9).v4p │ │ ├── _credits.txt │ │ ├── hebe.x │ │ ├── ssao_blur.fx │ │ ├── ssao_do_ssao.fx │ │ ├── ssao_edge_blur.fx │ │ └── ssao_fill_front.fx │ ├── _advanced │ │ ├── IntegralTransform │ │ │ ├── Integral (Transform) help.v4p │ │ │ ├── Integral.cs │ │ │ ├── Integral.csproj │ │ │ ├── Integral.sln │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── _credits.txt │ │ ├── Mandelbulb │ │ │ ├── Mandelbulb help.v4p │ │ │ ├── Mandelbulb.fx │ │ │ └── _credits.txt │ │ └── QJuliaSet │ │ │ ├── QuaterionJuliaSet.fx │ │ │ ├── ROOT.v4p │ │ │ └── _credits.txt │ └── plugins │ │ ├── 3dCubePyramid │ │ ├── 3dCubePyramid.csproj │ │ ├── C3dCubePyramidNode.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ └── KochCurve2d │ │ ├── KochCurve2d.csproj │ │ ├── KochCurve2dNode.cs │ │ └── Properties │ │ └── AssemblyInfo.cs └── 03_Droste │ ├── _Droste.jpg │ ├── _Hogan_Droste.jpg │ └── droste │ ├── Bicubic.fxh │ ├── BicubicFilterKernel.hdr │ ├── Droste.fx │ ├── Droste.v4p │ └── _credits.txt ├── 03_Math ├── 01_Formulas2d │ └── Formulas2d.v4p ├── 02_Trigonometry │ ├── Trigonometry.v4p │ ├── Trigonometry_Spirograph.v4p │ ├── Trigonometry_Spirograph_PlotGraph.v4p │ └── _advanced │ │ └── PlaneCurves │ │ ├── _credits.txt │ │ ├── _root_PlaneCurves.v4p │ │ └── plugins │ │ ├── 2dBifolium │ │ ├── 2dBifolium.csproj │ │ ├── Bifolium (2d) help.v4p │ │ ├── C2dBifoliumNode.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── 2dLemniscateOfGerono │ │ ├── 2dLemniscateOfGerono.csproj │ │ ├── C2dLemniscateOfGeronoNode.cs │ │ ├── LemniscateOfGerono (2d) help.v4p │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── 2dNephroid │ │ ├── 2dNephroid.csproj │ │ ├── C2dNephroidNode.cs │ │ ├── Nephroid (2d) help.v4p │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── 2dRhodonea │ │ ├── 2dRhodonea.csproj │ │ ├── C2dRhodoneaNode.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Rhodonea (2d) help.v4p │ │ ├── Hypocycloid │ │ ├── Hypocycloid (2d) help.v4p │ │ ├── Hypocycloid.cs │ │ ├── Hypocycloid.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Hypotrochoid │ │ ├── Hypotrochoid (2d) help.v4p │ │ ├── Hypotrochoid.cs │ │ ├── Hypotrochoid.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── LimaconOfPascal │ │ ├── LimaconOfPascal (2d) help.v4p │ │ ├── LimaconOfPascal.cs │ │ ├── LimaconOfPascal.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Spiral2d │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Spiral (2d Equiangular) help.v4p │ │ ├── Spiral2d.cs │ │ └── Spiral2d.csproj ├── 03_Splines │ ├── 01_Interpolation.v4p │ ├── 02_B-Spline.v4p │ ├── 03_Bezier.v4p │ ├── 04_CubicSpline.v4p │ ├── _advanced │ │ └── SplinesGPU_ref.v4p │ └── subpatches │ │ ├── CatmullRom (Spreads).v4p │ │ └── DragY.v4p ├── 04_2dTo3d │ ├── 2dTo3d.v4p │ └── _advanced │ │ └── superformula 2d 3d │ │ ├── _credits.txt │ │ ├── superformula phong directionnal2d3d help.v4p │ │ └── superformula phong directionnal2d3d.fx ├── 05_ComplexNumbers │ ├── ComplexNumbers.v4p │ └── _advanced │ │ └── ComplexNumbers3d.v4p └── 06_3dShapes │ ├── 3dShapes.v4p │ └── _advanced │ ├── P_Q │ ├── Constant_Torus_P_Q.fx │ ├── P_Q.v4p │ └── _credits.txt │ ├── Surfaces_simple │ ├── Surfaces_01.fx │ ├── Surfaces_02.fx │ ├── Surfaces_03.fx │ ├── Surfaces_04.fx │ ├── Surfaces_05.fx │ ├── Surfaces_06.fx │ ├── Surfaces_simple help.v4p │ ├── _credits.txt │ └── content.txt │ └── superformula │ ├── _credits.txt │ ├── superformula phong directionnal.fx │ └── superformula.v4p ├── 04_PhysicsBio ├── 01_Lindenmayer │ └── Lindenmayer.v4p ├── 02_ReactiveDiffusion │ ├── ReactiveDiffusion.v4p │ ├── _credits.txt │ └── effects │ │ └── ReactiveDiffusion.fx ├── 03_DLA │ ├── 01_DiffusionLimitedAggregation.v4p │ ├── 02_DLA_NoIntersect.v4p │ ├── _advanced │ │ └── DLA_3D │ │ │ ├── 04_sphere_net.v4p │ │ │ ├── _credits.txt │ │ │ ├── add_sphere_by_moving.v4p │ │ │ └── spheres.v4p │ └── subpatches │ │ ├── Attach.v4p │ │ ├── CheckIntersect.v4p │ │ └── DistanceSort.v4p ├── 04_Attractor │ ├── Attractor.v4p │ ├── Attractor_SplinesGPU.v4p │ └── _advanced │ │ ├── ChaosToys_ref.v4p │ │ └── _credits.txt ├── 05_Particles │ └── Particles.v4p ├── 06_Agents │ ├── ParticlesAsAgents.v4p │ └── _advanced │ │ └── M_1_6_01_TOOL_Agents in the Space │ │ ├── AgentRibbon.v4p │ │ ├── Box.v4p │ │ ├── KeyboardControls.v4p │ │ ├── M_1_6_01_TOOL-DirectX Renderer_2012.10.08-20.45.44.png │ │ ├── M_1_6_01_TOOL.v4p │ │ ├── StepCalculation.v4p │ │ ├── ViewTransform.v4p │ │ └── _credits.txt └── 07_Swarming │ ├── 1AnimationFlockingBehavior.dll │ ├── AnimalBehaviors.v4p │ ├── Behaviorss │ ├── AnimalBehavior_subPatch.v4p │ ├── Behaviors_Save.v4p │ └── Helpers.v4p │ ├── Skills.v4p │ ├── Skills │ ├── FlockingBehavior_subPatch.v4p │ ├── Helpers.v4p │ └── Taget_EnemyGenerator.v4p │ ├── _credits.txt │ └── arrow3d_1.x ├── 05_Tessellation ├── 01_ConnectAll │ ├── ConnectAll.v4p │ └── ConnectAll │ │ ├── ConnectAll.cs │ │ ├── ConnectAll.csproj │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── _credits.txt ├── 02_TriangulationDelaunay │ └── Delaunay.v4p └── 03_Voronoi │ └── Voronoi.v4p ├── 06_CG ├── 01_GeometryDeformation │ ├── GeometryDeformation.v4p │ └── _advanced │ │ ├── _credits.txt │ │ └── fluiDynamicSphere_ref.v4p ├── 02_VertexDisplacement │ ├── 02_DisplacementMap.v4p │ ├── _advanced │ │ └── Heightmap Displacement │ │ │ ├── HeightmapDisplacement help.v4p │ │ │ ├── HeightmapDisplacement.fx │ │ │ ├── _credits.txt │ │ │ └── grcanyon.PNG │ └── effects │ │ └── Displacement.fx └── 03_PixelDisplacement │ ├── SelfDisplacement.fx │ ├── SelfDisplacement.v4p │ ├── _credits.txt │ └── dot.jpg ├── contributions ├── ChaosToys │ ├── _credits.txt │ ├── _root_ChaosToys.v4p │ └── plugins │ │ ├── 2dPeano │ │ ├── 2dPeano.csproj │ │ ├── C2dPeanoNode.cs │ │ ├── Peano (2d) help.v4p │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── CircleInversion.dll │ │ ├── CliffordAttractor (Animation) help.v4p │ │ ├── CliffordAttractor.dll │ │ ├── DuffingOscillator (Animation) help.v4p │ │ ├── DuffingOscillator.dll │ │ ├── Ikeda (Animation) help.v4p │ │ ├── Ikeda.dll │ │ ├── Koch │ │ ├── Koch (2d) help.v4p │ │ ├── Koch.cs │ │ ├── Koch.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── LorenzAttractor (Animation) help.v4p │ │ ├── LorenzAttractor.dll │ │ ├── RösslerAttractor (Animation) help.v4p │ │ ├── RösslerAttractor.dll │ │ ├── TamariAttractor (Animation) help.v4p │ │ ├── TamariAttractor.dll │ │ ├── TemplateChaosToy2d0.1 │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── TemplateChaosToy (2d) help.v4p │ │ ├── TemplateChaosToy2d0.1.cs │ │ └── TemplateChaosToy2d0.1.csproj │ │ ├── TinkerBell (Animation) help.v4p │ │ ├── TinkerBell.dll │ │ └── halo dot.bmp └── SplinesGPU │ ├── B-Spline Cubic PhongDirectional GPU help.v4p │ ├── Bezier-Spline PhongDirectional GPU help.v4p │ ├── Bezier-Spline Piecewise PhongDirectional GPU help.v4p │ ├── Cosine-Spline PhongDirectional GPU help.v4p │ ├── Cubic-Spline PhongDirectional GPU help.v4p │ ├── Linear-Spline PhongDirectional GPU help.v4p │ ├── TCB-Spline PhongDirectional GPU help.v4p │ ├── _credits.txt │ ├── effects │ ├── B-Spline Cubic PhongDirectional GPU.fx │ ├── Bezier-Spline PhongDirectional GPU.fx │ ├── Bezier-Spline Piecewise PhongDirectional GPU.fx │ ├── Cosine-Spline PhongDirectional GPU.fx │ ├── Cubic-Spline PhongDirectional GPU.fx │ ├── Linear-Spline PhongDirectional GPU.fx │ └── TCB-Spline PhongDirectional GPU.fx │ └── subpatches │ └── Spline (EX9 Mesh).v4p └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]uild/ 3 | [Oo]bj/ 4 | [Dd]eploy/ 5 | 6 | 7 | # mstest test results 8 | TestResults 9 | 10 | ## Ignore Visual Studio temporary files, build results, and 11 | ## files generated by popular Visual Studio add-ons. 12 | 13 | # User-specific files 14 | *.suo 15 | *.user 16 | *.sln.docstates 17 | *~.xml 18 | 19 | # vvvv 20 | *~temp.v4p 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Rr]elease/ 25 | [Dd]ynamic/ 26 | 27 | *_i.c 28 | *_p.c 29 | *.ilk 30 | *.meta 31 | *.obj 32 | *.pch 33 | *.pdb 34 | *.pgc 35 | *.pgd 36 | *.rsp 37 | *.sbr 38 | *.tlb 39 | *.tli 40 | *.tlh 41 | *.tmp 42 | *.log 43 | *.vspscc 44 | *.vssscc 45 | .builds 46 | 47 | # Visual C++ cache files 48 | ipch/ 49 | *.aps 50 | *.ncb 51 | *.opensdf 52 | *.sdf 53 | 54 | # Visual Studio profiler 55 | *.psess 56 | *.vsp 57 | *.vspx 58 | 59 | # Guidance Automation Toolkit 60 | *.gpState 61 | 62 | # ReSharper is a .NET coding add-in 63 | _ReSharper* 64 | 65 | # NCrunch 66 | *.ncrunch* 67 | .*crunch*.local.xml 68 | 69 | # Installshield output folder 70 | [Ee]xpress 71 | 72 | # DocProject is a documentation generator add-in 73 | DocProject/buildhelp/ 74 | DocProject/Help/*.HxT 75 | DocProject/Help/*.HxC 76 | DocProject/Help/*.hhc 77 | DocProject/Help/*.hhk 78 | DocProject/Help/*.hhp 79 | DocProject/Help/Html2 80 | DocProject/Help/html 81 | 82 | # Click-Once directory 83 | publish 84 | 85 | # Publish Web Output 86 | *.Publish.xml 87 | 88 | # NuGet Packages Directory 89 | packages 90 | .nuget 91 | 92 | # Windows Azure Build Output 93 | csx 94 | *.build.csdef 95 | 96 | # Windows Store app package directory 97 | AppPackages/ 98 | 99 | # Others 100 | *.Cache 101 | *.dbmdl 102 | *.db -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/Bubble/CloudyHillsCubemap2.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/01_Random/02_Noise/_advanced/VertexNoisePack/Bubble/CloudyHillsCubemap2.dds -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/Bubble/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/TentaclePhongDirectional/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoise/VertexNoise.fx: -------------------------------------------------------------------------------- 1 | /* 2 | 3D Perlin Noise on the vertex shader 3 | based originally on vBomb.fx HLSL vertex noise shader, 4 | from the NVIDIA Shader Library. 5 | 6 | based on Ken Perlins original code: 7 | http://mrl.nyu.edu/~perlin/doc/oscar.html 8 | 9 | vvvv setup : desaxismundi 10 | http://vvvv.org/users/desaxismundi 11 | 12 | */ 13 | // -------------------------------------------------------------------------------------------------- 14 | // PARAMETERS: 15 | // -------------------------------------------------------------------------------------------------- 16 | 17 | //transforms 18 | float4x4 tWVP : WorldViewProjection; 19 | 20 | float4x4 TT ; 21 | 22 | float4x4 NoiseMatrix = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; 23 | 24 | //color 25 | float4 col : COLOR = {1, 1, 1, 1}; 26 | 27 | //texture 28 | texture Tex ; 29 | sampler Samp = sampler_state //sampler for doing the texture-lookup 30 | { 31 | Texture = (Tex); //apply a texture to the sampler 32 | MipFilter = LINEAR; //sampler states 33 | MinFilter = LINEAR; 34 | MagFilter = LINEAR; 35 | }; 36 | 37 | float4x4 tTex: TEXTUREMATRIX ; 38 | float4x4 tColor ; 39 | 40 | float timer : TIME; 41 | 42 | float TurbDensity 45 | = 2.27; 46 | 47 | float Disp 49 | = 1.6; 50 | 51 | float Sharp 53 | = 1.90; 54 | 55 | float Speed 57 | = 0.3; 58 | 59 | float ColorRange 61 | = -2.0; 62 | 63 | float ColSharp 65 | = 3.0; 66 | 67 | //float4 dd[5] = {0,2,3,1, 2,2,2,2, 3,3,3,3, 4,4,4,4, 5,5,5,5 }; 68 | 69 | struct vs2ps 70 | { 71 | float4 Pos : POSITION; 72 | half4 TexCoord : TEXCOORD0; 73 | float4 colpos : TEXCOORD1; 74 | 75 | }; 76 | 77 | // -------------------------------------------------------------------------------------------------- 78 | // FUNCTIONS: 79 | // -------------------------------------------------------------------------------------------------- 80 | 81 | // include the noise-table 82 | #include "vnoise-table.fxh" 83 | 84 | #define TWOPI 6.28318531 85 | #define PI 3.14159265 86 | 87 | // this is the smoothstep function f(t) = 3t^2 - 2t^3, without the normalization 88 | float3 scurve3D(float3 t) { return t*t*( float3(3,3,3) - float3(2,2,2)*t); } 89 | 90 | // 3D version 91 | float noise3D(float3 v, 92 | const uniform float4 pg[FULLSIZE]) 93 | { 94 | //v = v + float3(10000.0, 10000.0, 10000.0); // hack to avoid negative numbers 95 | v = v + abs(v); 96 | 97 | float3 i = frac(v * NOISEFRAC) * BSIZE; // index between 0 and BSIZE-1 98 | float3 f = frac(v); // fractional position 99 | 100 | // lookup in permutation table 101 | float2 p; 102 | p.x = pg[ i[0] ].w; 103 | p.y = pg[ i[0] + 1 ].w; 104 | p = p + i[1]; 105 | 106 | float4 b; 107 | b.x = pg[ p[0] ].w; 108 | b.y = pg[ p[1] ].w; 109 | b.z = pg[ p[0] + 1 ].w; 110 | b.w = pg[ p[1] + 1 ].w; 111 | b = b + i[2]; 112 | 113 | // compute dot products between gradients and vectors 114 | float4 r; 115 | r[0] = dot( pg[ b[0] ].xyz, f ); 116 | r[1] = dot( pg[ b[1] ].xyz, f - float3(1.0, 0.0, 0.0) ); 117 | r[2] = dot( pg[ b[2] ].xyz, f - float3(0.0, 1.0, 0.0) ); 118 | r[3] = dot( pg[ b[3] ].xyz, f - float3(1.0, 1.0, 0.0) ); 119 | 120 | float4 r1; 121 | r1[0] = dot( pg[ b[0] + 1 ].xyz, f - float3(0.0, 0.0, 1.0) ); 122 | r1[1] = dot( pg[ b[1] + 1 ].xyz, f - float3(1.0, 0.0, 1.0) ); 123 | r1[2] = dot( pg[ b[2] + 1 ].xyz, f - float3(0.0, 1.0, 1.0) ); 124 | r1[3] = dot( pg[ b[3] + 1 ].xyz, f - float3(1.0, 1.0, 1.0) ); 125 | 126 | // interpolate 127 | f = scurve3D(f); 128 | r = lerp( r, r1, f[2] ); 129 | r = lerp( r.xyyy, r.zwww, f[1] ); 130 | return lerp( r.x, r.y, f[0] ); 131 | } 132 | 133 | // -------------------------------------------------------------------------------------------------- 134 | // VERTEXSHADERS 135 | // -------------------------------------------------------------------------------------------------- 136 | 137 | ///3D 138 | vs2ps VS_Noise( 139 | float4 PosO: POSITION, 140 | float3 NormO: NORMAL, 141 | float4 TexCd : TEXCOORD0) 142 | { 143 | //inititalize all fields of output struct with 0 144 | vs2ps OUT = (vs2ps)0; 145 | 146 | PosO = mul(PosO, TT); 147 | 148 | float u = (PosO.x) * TWOPI; 149 | float v = (PosO.y) * PI; 150 | 151 | PosO.x = cos(v) * sin(u) ; 152 | PosO.y = sin(v) * sin(u) ; 153 | PosO.z = cos(u) ; 154 | 155 | float4 noisePos = TurbDensity*mul(PosO+(Speed*timer),NoiseMatrix); 156 | float i = (noise3D(noisePos.xyz, NTab) + 1.0) * 0.5f; 157 | float cr = 1.0-(0.5+ColorRange*(i-0.5)); 158 | cr = pow(cr,ColSharp); 159 | OUT.colpos = float4((cr).xxx, 1.0); 160 | 161 | // displacement along normal 162 | float ni = pow(abs(i),Sharp); 163 | i -= 0.5; 164 | 165 | float4 Nn = float4(normalize(PosO).xyz,0); 166 | 167 | half4 NewPos= PosO - (Nn * (ni-0.5) * Disp); 168 | 169 | OUT.TexCoord = mul(TexCd, tTex); 170 | OUT.Pos = mul(NewPos,tWVP); 171 | 172 | return OUT; 173 | } 174 | 175 | // -------------------------------------------------------------------------------------------------- 176 | // PIXELSHADERS: 177 | // -------------------------------------------------------------------------------------------------- 178 | 179 | float4 PS(vs2ps IN) : COLOR 180 | { 181 | float4 src = tex2D(Samp, IN.TexCoord); 182 | float4 col1 = (IN.colpos * src * col); 183 | 184 | return mul(col1,tColor); 185 | } 186 | 187 | // -------------------------------------------------------------------------------------------------- 188 | // TECHNIQUES: 189 | // -------------------------------------------------------------------------------------------------- 190 | 191 | technique VertexNoise 192 | { 193 | pass P0 194 | { 195 | Wrap0 = U; // useful when mesh is round like a sphere 196 | VertexShader = compile vs_2_0 VS_Noise(); 197 | PixelShader = compile ps_2_0 PS(); 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoise/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoiseGoochy/FireGrade.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoiseGoochy/FireGrade.bmp -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoiseGoochy/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoisePhongDirectional/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoiseReflections/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/VertexNoiseVelvety/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/vertex-noise-pack 2 | 3 | by desaxismundis -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/vBomb/FireGrade.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/01_Random/02_Noise/_advanced/VertexNoisePack/vBomb/FireGrade.bmp -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/vBomb/vBomb.fx: -------------------------------------------------------------------------------- 1 | /* 2 | 3D Perlin Noise on the vertex shader 3 | based originally on vBomb.fx HLSL vertex noise shader, 4 | from the NVIDIA Shader Library. 5 | 6 | based on Ken Perlins original code: 7 | http://mrl.nyu.edu/~perlin/doc/oscar.html 8 | 9 | vvvv setup : desaxismundi 10 | http://vvvv.org/users/desaxismundi 11 | 12 | */ 13 | // -------------------------------------------------------------------------------------------------- 14 | // PARAMETERS: 15 | // -------------------------------------------------------------------------------------------------- 16 | 17 | //transforms 18 | float4x4 tW : WORLD; //the models world matrix 19 | float4x4 tV : VIEW; //view matrix as set via Renderer (EX9) 20 | float4x4 tP : PROJECTION; //projection matrix as set via Renderer (EX9) 21 | float4x4 tWVP : WORLDVIEWPROJECTION; 22 | 23 | // include the noise-table 24 | #include "vnoise-table.fxh" 25 | 26 | ////////////texture//////////////////////////////////////// 27 | 28 | texture Tex ; 29 | sampler Samp = sampler_state //sampler for doing the texture-lookup 30 | { 31 | Texture = (Tex); //apply a texture to the sampler 32 | MinFilter = LINEAR; 33 | MagFilter = LINEAR; //sampler states 34 | MipFilter = POINT; 35 | AddressU = CLAMP; 36 | AddressV = CLAMP; 37 | }; 38 | 39 | float4x4 NoiseMatrix = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; 40 | 41 | float timer : TIME; 42 | 43 | float4 tColor : color ; 44 | 45 | float Disp 49 | = 1.6; 50 | 51 | float Sharp 55 | = 1.90; 56 | 57 | float Speed 61 | = 0.3; 62 | 63 | float TurbDensity 67 | = 2.27; 68 | 69 | float ColSharp 73 | = 3.0; 74 | 75 | float ColorRange 79 | = -2.0; 80 | 81 | //float4 dd[5] = {0,2,3,1, 2,2,2,2, 3,3,3,3, 4,4,4,4, 5,5,5,5 }; 82 | 83 | 84 | ///////////// functions////////////////////////////////////////////////////////// 85 | 86 | // this is the smoothstep function f(t) = 3t^2 - 2t^3, without the normalization 87 | float3 scurve3D(float3 t) { return t*t*( float3(3,3,3) - float3(2,2,2)*t); } 88 | float2 scurve2D(float2 t) { return t*t*( float2(3,3) - float2(2,2)*t); } 89 | float scurve1D(float t) { return t*t*(3.0-2.0*t); } 90 | 91 | // 3D version 92 | float noise3D(float3 v, 93 | const uniform float4 pg[FULLSIZE]) 94 | { 95 | //v = v + float3(10000.0, 10000.0, 10000.0); // hack to avoid negative numbers 96 | v = v + abs(v); 97 | 98 | 99 | float3 i = frac(v * NOISEFRAC) * BSIZE; // index between 0 and BSIZE-1 100 | float3 f = frac(v); // fractional position 101 | 102 | // lookup in permutation table 103 | float2 p; 104 | p.x = pg[ i[0] ].w; 105 | p.y = pg[ i[0] + 1 ].w; 106 | p = p + i[1]; 107 | 108 | float4 b; 109 | b.x = pg[ p[0] ].w; 110 | b.y = pg[ p[1] ].w; 111 | b.z = pg[ p[0] + 1 ].w; 112 | b.w = pg[ p[1] + 1 ].w; 113 | b = b + i[2]; 114 | 115 | // compute dot products between gradients and vectors 116 | float4 r; 117 | r[0] = dot( pg[ b[0] ].xyz, f ); 118 | r[1] = dot( pg[ b[1] ].xyz, f - float3(1.0, 0.0, 0.0) ); 119 | r[2] = dot( pg[ b[2] ].xyz, f - float3(0.0, 1.0, 0.0) ); 120 | r[3] = dot( pg[ b[3] ].xyz, f - float3(1.0, 1.0, 0.0) ); 121 | 122 | float4 r1; 123 | r1[0] = dot( pg[ b[0] + 1 ].xyz, f - float3(0.0, 0.0, 1.0) ); 124 | r1[1] = dot( pg[ b[1] + 1 ].xyz, f - float3(1.0, 0.0, 1.0) ); 125 | r1[2] = dot( pg[ b[2] + 1 ].xyz, f - float3(0.0, 1.0, 1.0) ); 126 | r1[3] = dot( pg[ b[3] + 1 ].xyz, f - float3(1.0, 1.0, 1.0) ); 127 | 128 | // interpolate 129 | f = scurve3D(f); 130 | r = lerp( r, r1, f[2] ); 131 | r = lerp( r.xyyy, r.zwww, f[1] ); 132 | return lerp( r.x, r.y, f[0] ); 133 | } 134 | 135 | 136 | // define outputs from vertex shader 137 | struct vs2ps 138 | { 139 | float4 Pos : POSITION; 140 | float4 Color0 : COLOR0; 141 | }; 142 | 143 | // -------------------------------------------------------------------------------------------------- 144 | // VERTEXSHADERS 145 | // -------------------------------------------------------------------------------------------------- 146 | 147 | vs2ps VS_vBomb3D( 148 | float4 PosO : POSITION, 149 | float4 NormO : NORMAL, 150 | float4 TexCd : TEXCOORD0) 151 | { 152 | //inititalize all fields of output struct with 0 153 | vs2ps OUT = (vs2ps)0; 154 | 155 | float4 noisePos = TurbDensity*mul(PosO+(Speed*timer),NoiseMatrix); 156 | float i = (noise3D(noisePos.xyz, NTab) + 1.0) * 0.5f; 157 | float cr = 1.0-(0.5+ColorRange*(i-0.5)); 158 | cr = pow(cr,ColSharp); 159 | OUT.Color0 = float4((cr).xxx, 1.0); 160 | // displacement along normal 161 | float ni = pow(abs(i),Sharp); 162 | i -= 0.5; 163 | //i = sign(i) * pow(i,Sharpness); 164 | // we will use our own "normal" vector because the default geom is a sphere 165 | float4 Nn = float4(normalize(PosO).xyz,0); 166 | float4 NewPos = PosO - (Nn * (ni-0.5) * Disp); 167 | //position.w = 1.0f; 168 | OUT.Pos = mul(NewPos,tWVP); 169 | return OUT; 170 | } 171 | 172 | // -------------------------------------------------------------------------------------------------- 173 | // PIXELSHADERS: 174 | // -------------------------------------------------------------------------------------------------- 175 | 176 | float4 PS(vs2ps IN) : COLOR 177 | { 178 | float2 nuv = float2(IN.Color0.x,0.5); 179 | float4 nc = tex2D(Samp,nuv); 180 | //return float4(IN.Color0.xxx,1.0); 181 | return nc*tColor; 182 | } 183 | 184 | 185 | // -------------------------------------------------------------------------------------------------- 186 | // TECHNIQUE: 187 | // -------------------------------------------------------------------------------------------------- 188 | 189 | technique vBomb3Dnoise 190 | { 191 | pass p0 192 | 193 | { 194 | VertexShader = compile vs_2_0 VS_vBomb3D(); 195 | PixelShader = compile ps_2_0 PS(); 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /01_Random/02_Noise/_advanced/VertexNoisePack/vBomb/vnoise-table.fxh: -------------------------------------------------------------------------------- 1 | // NOISE TABLE, seed value: 0 ///////////////////// 2 | 3 | #define BSIZE 32 4 | #define FULLSIZE 66 5 | #define NOISEFRAC 0.03125 6 | 7 | const float4 NTab[66] = {-0.854611,-0.453029,0.25378,0, 8 | -0.84528,-0.456307,-0.278002,1, 9 | -0.427197,0.847095,-0.316122,2, 10 | 0.670266,-0.496104,0.551928,3, 11 | -0.675674,-0.713842,0.184102,4, 12 | -0.0373602,-0.600265,0.798928,5, 13 | -0.939116,-0.119538,0.322135,6, 14 | 0.818521,0.278224,0.502609,7, 15 | 0.105335,-0.765291,0.635007,8, 16 | -0.634436,-0.298693,0.712933,9, 17 | -0.532414,-0.603311,-0.593761,10, 18 | 0.411375,0.0976618,0.906219,11, 19 | 0.798824,-0.416379,-0.434175,12, 20 | -0.691156,0.585681,-0.423415,13, 21 | 0.612298,0.0777332,0.786797,14, 22 | 0.264612,-0.262848,0.927842,15, 23 | -0.70809,0.0548396,-0.703989,16, 24 | 0.933195,-0.294222,-0.206349,17, 25 | 0.788936,-0.466718,-0.399692,18, 26 | -0.540183,-0.824413,0.168954,19, 27 | 0.469322,-0.184125,0.863617,20, 28 | -0.84773,0.292229,-0.44267,21, 29 | 0.450832,0.650314,-0.611427,22, 30 | 0.906378,-0.247125,-0.342647,23, 31 | -0.995052,0.0271277,-0.0955848,24, 32 | -0.0252277,-0.778349,0.627325,25, 33 | 0.991428,0.128623,0.0229457,26, 34 | -0.842581,-0.290688,0.453384,27, 35 | -0.662511,-0.500545,-0.557256,28, 36 | 0.650245,-0.692099,-0.313338,29, 37 | 0.636901,0.768918,-0.0558766,30, 38 | -0.437006,0.872104,-0.220138,31, 39 | -0.854611,-0.453029,0.25378,0, 40 | -0.84528,-0.456307,-0.278002,1, 41 | -0.427197,0.847095,-0.316122,2, 42 | 0.670266,-0.496104,0.551928,3, 43 | -0.675674,-0.713842,0.184102,4, 44 | -0.0373602,-0.600265,0.798928,5, 45 | -0.939116,-0.119538,0.322135,6, 46 | 0.818521,0.278224,0.502609,7, 47 | 0.105335,-0.765291,0.635007,8, 48 | -0.634436,-0.298693,0.712933,9, 49 | -0.532414,-0.603311,-0.593761,10, 50 | 0.411375,0.0976618,0.906219,11, 51 | 0.798824,-0.416379,-0.434175,12, 52 | -0.691156,0.585681,-0.423415,13, 53 | 0.612298,0.0777332,0.786797,14, 54 | 0.264612,-0.262848,0.927842,15, 55 | -0.70809,0.0548396,-0.703989,16, 56 | 0.933195,-0.294222,-0.206349,17, 57 | 0.788936,-0.466718,-0.399692,18, 58 | -0.540183,-0.824413,0.168954,19, 59 | 0.469322,-0.184125,0.863617,20, 60 | -0.84773,0.292229,-0.44267,21, 61 | 0.450832,0.650314,-0.611427,22, 62 | 0.906378,-0.247125,-0.342647,23, 63 | -0.995052,0.0271277,-0.0955848,24, 64 | -0.0252277,-0.778349,0.627325,25, 65 | 0.991428,0.128623,0.0229457,26, 66 | -0.842581,-0.290688,0.453384,27, 67 | -0.662511,-0.500545,-0.557256,28, 68 | 0.650245,-0.692099,-0.313338,29, 69 | 0.636901,0.768918,-0.0558766,30, 70 | -0.437006,0.872104,-0.220138,31, 71 | -0.854611,-0.453029,0.25378,0, 72 | -0.84528,-0.456307,-0.278002,1}; 73 | 74 | ///////////////////////////// eof /// 75 | -------------------------------------------------------------------------------- /02_Feedback/01_Feedback/_advanced/feedback_machine/subs/control_frame_mouse.v4p: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/SSAO3/Meso_75.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/02_Feedback/02_Recursion/SSAO3/Meso_75.dds -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/SSAO3/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/interleaved-ssao-with-cubemap-lighting 2 | 3 | by m4d 4 | original technique http://vvvv.org/contribution/ssao 5 | initial version port by joreg 6 | edgeblur by dottore -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/SSAO3/ssao_blur.fx: -------------------------------------------------------------------------------- 1 | //@author: m4d 2 | //@help: interleaved SSAO - combinepass -- blurs the previous ssao pass and combines it with diffuse fill pass and additional cubemap lighting 3 | //@tags: ssao, interleaved, combine, cubemap, lighting 4 | //@credits: original shader by ArKano22 of gamedev.net -- see thread http://www.gamedev.net/community/forums/topic.asp?topic_id=556187&PageSize=25&WhichPage=1 5 | 6 | // -------------------------------------------------------------------------------------------------- 7 | // PARAMETERS: 8 | // -------------------------------------------------------------------------------------------------- 9 | 10 | //transforms 11 | float4x4 tW: WORLD; //the models world matrix 12 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 13 | float4x4 tP: PROJECTION; 14 | float4x4 tWVP: WORLDVIEWPROJECTION; 15 | 16 | //texture 17 | texture TexSSAO ; 18 | sampler SampSSAO = sampler_state //sampler for doing the texture-lookup 19 | { 20 | Texture = (TexSSAO); //apply a texture to the sampler 21 | MipFilter = none; //sampler states 22 | MinFilter = none; 23 | MagFilter = none; 24 | }; 25 | 26 | texture TexNorm ; 27 | sampler SampNorm = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (TexNorm); //apply a texture to the sampler 30 | MipFilter = none; //sampler states 31 | MinFilter = none; 32 | MagFilter = none; 33 | }; 34 | 35 | texture TexCube ; 36 | sampler SampCube = sampler_state //sampler for doing the texture-lookup 37 | { 38 | Texture = (TexCube); //apply a texture to the sampler 39 | MipFilter = linear; //sampler states 40 | MinFilter = linear; 41 | MagFilter = linear; 42 | }; 43 | 44 | texture TexDiffuse ; 45 | sampler SampDiffuse = sampler_state //sampler for doing the texture-lookup 46 | { 47 | Texture = (TexDiffuse); //apply a texture to the sampler 48 | MipFilter = none; //sampler states 49 | MinFilter = none; 50 | MagFilter = none; 51 | }; 52 | float2 InvScreenSize = 1; 53 | float Blur = 1; 54 | float UseAO = 1; 55 | float UseCube = 1; 56 | 57 | 58 | //the data structure: "vertexshader to pixelshader" 59 | //used as output data with the VS function 60 | //and as input data with the PS function 61 | struct vs2ps 62 | { 63 | float4 position : POSITION0; 64 | float2 uv : TEXCOORD0; 65 | }; 66 | 67 | // -------------------------------------------------------------------------------------------------- 68 | // VERTEXSHADERS 69 | // -------------------------------------------------------------------------------------------------- 70 | vs2ps VS( 71 | float4 position : POSITION, 72 | float4 uv : TEXCOORD0) 73 | { 74 | //declare output struct 75 | vs2ps Out; 76 | 77 | //transform position 78 | Out.position = float4(mul(position, tWVP)); 79 | 80 | //transform texturecoordinates 81 | Out.uv = uv; 82 | 83 | return Out; 84 | } 85 | 86 | // -------------------------------------------------------------------------------------------------- 87 | // PIXELSHADERS: 88 | // -------------------------------------------------------------------------------------------------- 89 | float3 getNormal(in float2 uv) 90 | { 91 | return normalize(tex2D(SampNorm,uv).xyz * 2.0f - 1.0f); 92 | } 93 | 94 | float4 PS(vs2ps In): COLOR 95 | { 96 | float4 o = (0.0,0.0,0.0,1.0); 97 | o = tex2D(SampDiffuse, In.uv); 98 | const float2 vec[3] = { 99 | float2(1,1), 100 | float2(1,0), 101 | float2(0,1), 102 | }; 103 | 104 | float3 n = getNormal(In.uv); 105 | 106 | float3 ao = tex2D(SampSSAO,In.uv).xyz; 107 | int samples = 1; 108 | for (int k=0;k<3;k++){ 109 | float2 tcoord = In.uv+float2(vec[k].x*InvScreenSize.x*Blur,vec[k].y*InvScreenSize.y*Blur); 110 | ao+=tex2D(SampSSAO,tcoord).xyz; 111 | samples++; 112 | } 113 | ao/=samples; 114 | 115 | float3 ccc = texCUBE(SampCube, n); 116 | float3 ambient = ccc+0.2; 117 | if (UseAO) 118 | ambient -= (saturate(ao)); 119 | 120 | if (UseCube) 121 | o.rgb *= ambient; 122 | else 123 | o.rgb = (1.0-saturate(ao)); 124 | return o; 125 | } 126 | 127 | // -------------------------------------------------------------------------------------------------- 128 | // TECHNIQUES: 129 | // -------------------------------------------------------------------------------------------------- 130 | 131 | technique TSimpleShader 132 | { 133 | pass P0 134 | { 135 | //Wrap0 = U; // useful when mesh is round like a sphere 136 | VertexShader = compile vs_3_0 VS(); 137 | PixelShader = compile ps_3_0 PS(); 138 | } 139 | } 140 | 141 | technique TFixedFunction 142 | { 143 | pass P0 144 | { 145 | //transforms 146 | WorldTransform[0] = (tW); 147 | ViewTransform = (tV); 148 | ProjectionTransform = (tP); 149 | 150 | //texturing 151 | Sampler[0] = (SampDiffuse); 152 | TexCoordIndex[0] = 0; 153 | TextureTransformFlags[0] = COUNT2; 154 | //Wrap0 = U; // useful when mesh is round like a sphere 155 | 156 | Lighting = FALSE; 157 | 158 | //shaders 159 | VertexShader = NULL; 160 | PixelShader = NULL; 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/SSAO3/ssao_do_ssao.fx: -------------------------------------------------------------------------------- 1 | //@author: m4d 2 | //@help: interleaved SSAO - ssao pass -- renders the ssao from the previous normal and position passes 3 | //@tags: ssao, interleaved 4 | //@credits: original shader by ArKano22 of gamedev.net -- see thread http://www.gamedev.net/community/forums/topic.asp?topic_id=556187&PageSize=25&WhichPage=1 -- additional HLSL by martinsh of gamedev.net (posted in same thread) 5 | 6 | // -------------------------------------------------------------------------------------------------- 7 | // PARAMETERS: 8 | // -------------------------------------------------------------------------------------------------- 9 | 10 | //transforms 11 | float4x4 tW: WORLD; //the models world matrix 12 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 13 | float4x4 tP: PROJECTION; 14 | float4x4 tWVP: WORLDVIEWPROJECTION; 15 | 16 | //textures 17 | texture TexNorm ; 18 | sampler SampNorm = sampler_state //sampler for doing the texture-lookup 19 | { 20 | Texture = (TexNorm); //apply a texture to the sampler 21 | MipFilter = POINT; //sampler states 22 | MinFilter = POINT; 23 | MagFilter = POINT; 24 | }; 25 | 26 | texture TexPos ; 27 | sampler SampPos = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (TexPos); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | }; 34 | 35 | //parameters 36 | float SampleRadius = 0.1; 37 | float Intensity = 0.46; 38 | float Scale = 0.6; 39 | float Bias = 0.04; 40 | float SelfOcclusion = 0.07; 41 | float2 ScreenSize = 1; 42 | float2 InvScreenSize = 1; 43 | 44 | 45 | //the data structure: "vertexshader to pixelshader" 46 | //used as output data with the VS function 47 | //and as input data with the PS function 48 | struct vs2ps 49 | { 50 | float4 position : POSITION; 51 | float2 uv : TEXCOORD0; 52 | }; 53 | 54 | // -------------------------------------------------------------------------------------------------- 55 | // VERTEXSHADERS 56 | // -------------------------------------------------------------------------------------------------- 57 | vs2ps VS( 58 | float4 position : POSITION 59 | ) 60 | { 61 | //declare output struct 62 | vs2ps Out; 63 | 64 | //transform position 65 | Out.position = float4(sign(position.xy), 0.0f, 1.0f); 66 | 67 | //transform texturecoordinates 68 | Out.uv = position.xy * float2(1,-1) + 0.5f; 69 | 70 | Out.position.x -= InvScreenSize.x; 71 | Out.position.y += InvScreenSize.y; 72 | 73 | return Out; 74 | } 75 | 76 | // -------------------------------------------------------------------------------------------------- 77 | // PIXELSHADERS: 78 | // -------------------------------------------------------------------------------------------------- 79 | 80 | float3 getPosition(in float2 uv) 81 | { 82 | return tex2Dlod(SampPos,float4(uv,0,0)).xyz; 83 | } 84 | float3 getNormal(in float2 uv) 85 | { 86 | return normalize(tex2D(SampNorm, uv).xyz * 2.0f - 1.0f); 87 | } 88 | 89 | float getRandom(in float2 uv) 90 | { 91 | return ((frac(uv.x * (ScreenSize.x/2.0))*0.25)+(frac(uv.y*(ScreenSize.y/2.0))*0.5)); 92 | } 93 | 94 | float doAmbientOcclusion(in float2 tcoord,in float2 uv, in float3 p, in float3 cnorm) 95 | { 96 | float3 diff = getPosition(tcoord + uv) - p; 97 | const float3 v = normalize(diff); 98 | const float d = length(diff)*Scale; 99 | return max(0.0-SelfOcclusion,dot(cnorm,v)-Bias)*(1.0/(1.0+d*d))*Intensity; 100 | 101 | } 102 | 103 | float4 SSAO(vs2ps In): COLOR 104 | { 105 | const float3 vec[14] = {float3(1,1,-1),float3(1,-1,-1), 106 | float3(1,1,1),float3(1,-1,1), 107 | float3(-1,1,-1),float3(-1,-1,-1), 108 | float3(-1,1,1),float3(-1,-1,1), 109 | 110 | float3(1,0,0),float3(-1,0,0), 111 | float3(0,1,0),float3(0,-1,0), 112 | float3(0,0,1),float3(0,0,-1), 113 | }; 114 | 115 | float4 o = (0.0,0.0,0.0,1.0); 116 | float3 p = getPosition(In.uv); 117 | float3 n = getNormal(In.uv); 118 | float rand = getRandom(In.uv); 119 | 120 | float ao = 0.0; 121 | float rad = SampleRadius/p.z; 122 | //**SSAO Calculation**// 123 | 124 | for (int j = 0; j < 14; ++j) 125 | { 126 | float4 coord = mul(vec[j]*rad*rand,tWVP); 127 | coord.y = ScreenSize.y-coord.y; 128 | ao += doAmbientOcclusion(In.uv,coord*InvScreenSize*1000.0, p, n ); 129 | } 130 | ao/=8; 131 | ao+=SelfOcclusion; 132 | 133 | o.rgb = ao; 134 | //**END**// 135 | return o; 136 | } 137 | 138 | // -------------------------------------------------------------------------------------------------- 139 | // TECHNIQUES: 140 | // -------------------------------------------------------------------------------------------------- 141 | 142 | technique TSSAO 143 | { 144 | pass P0 145 | { 146 | //Wrap0 = U; // useful when mesh is round like a sphere 147 | VertexShader = compile vs_3_0 VS(); 148 | PixelShader = compile ps_3_0 SSAO(); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/SSAO3/ssao_fill_front.fx: -------------------------------------------------------------------------------- 1 | //@author: m4d 2 | //@help: interleaved SSAO - fill pass -- renders normal, position and diffuse passes 3 | //@tags: ssao, interleaved 4 | //@credits: original shader by ArKano22 of gamedev.net -- see thread http://www.gamedev.net/community/forums/topic.asp?topic_id=556187&PageSize=25&WhichPage=1 5 | 6 | // -------------------------------------------------------------------------------------------------- 7 | // PARAMETERS: 8 | // -------------------------------------------------------------------------------------------------- 9 | 10 | //transforms 11 | float4x4 tW: WORLD; //the models world matrix 12 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 13 | float4x4 tP: PROJECTION; 14 | float4x4 tWVP: WORLDVIEWPROJECTION; 15 | float4x4 tWV: WORLDVIEW; 16 | 17 | //texture 18 | texture Tex ; 19 | sampler SampTex = sampler_state //sampler for doing the texture-lookup 20 | { 21 | Texture = (Tex); //apply a texture to the sampler 22 | MipFilter = LINEAR; //sampler states 23 | MinFilter = LINEAR; 24 | MagFilter = LINEAR; 25 | }; 26 | 27 | //texture transformation marked with semantic TEXTUREMATRIX to achieve symmetric transformations 28 | float4x4 tTex: TEXTUREMATRIX ; 29 | 30 | //the data structure: "vertexshader to pixelshader" 31 | //used as output data with the VS function 32 | //and as input data with the PS function 33 | struct vs2ps 34 | { 35 | float4 position : POSITION; 36 | float2 uv : TEXCOORD0; 37 | float3 camera_position : TEXCOORD1; 38 | float3 camera_normal : TEXCOORD2; 39 | }; 40 | 41 | // -------------------------------------------------------------------------------------------------- 42 | // VERTEXSHADERS 43 | // -------------------------------------------------------------------------------------------------- 44 | vs2ps VS( 45 | float4 PosO : POSITION, 46 | float3 normal : NORMAL0, 47 | float4 TexCd : TEXCOORD0) 48 | { 49 | //inititalize all fields of output struct with 0 50 | vs2ps Out = (vs2ps)0; 51 | 52 | //transform position 53 | Out.position = mul(PosO, tWVP); 54 | 55 | //transform texturecoordinates 56 | Out.uv = TexCd; 57 | 58 | Out.camera_position = mul(PosO, tWV); 59 | 60 | Out.camera_normal = mul(normal, tWV); 61 | return Out; 62 | } 63 | 64 | // -------------------------------------------------------------------------------------------------- 65 | // PIXELSHADERS: 66 | // -------------------------------------------------------------------------------------------------- 67 | 68 | struct col2 69 | { 70 | float4 c1 : COLOR0; 71 | float4 c2 : COLOR1; 72 | float4 c3 : COLOR2; 73 | }; 74 | 75 | col2 PS(vs2ps In) 76 | { 77 | col2 c; 78 | 79 | c.c3.rgba = 1.0; 80 | 81 | float depth = length(In.camera_position.xyz); 82 | float3 norm = normalize(In.camera_normal); 83 | norm.z *= 1.0; 84 | c.c1 = float4(norm * 0.5f + 0.5f, max(depth,1)); 85 | 86 | 87 | c.c2.xyz = In.camera_position; 88 | c.c2.w = 1.0f; 89 | 90 | c.c3.rgb = tex2D(SampTex, In.uv).rgb; 91 | 92 | return c; 93 | } 94 | 95 | // -------------------------------------------------------------------------------------------------- 96 | // TECHNIQUES: 97 | // -------------------------------------------------------------------------------------------------- 98 | 99 | technique TSimpleShader 100 | { 101 | pass SSAO_FillFront 102 | { 103 | //Wrap0 = U; // useful when mesh is round like a sphere 104 | VertexShader = compile vs_3_0 VS(); 105 | PixelShader = compile ps_3_0 PS(); 106 | } 107 | } 108 | 109 | technique TFixedFunction 110 | { 111 | pass P0 112 | { 113 | //transforms 114 | WorldTransform[0] = (tW); 115 | ViewTransform = (tV); 116 | ProjectionTransform = (tP); 117 | 118 | //texturing 119 | Sampler[0] = (SampTex); 120 | TextureTransform[0] = (tTex); 121 | TexCoordIndex[0] = 0; 122 | TextureTransformFlags[0] = COUNT2; 123 | //Wrap0 = U; // useful when mesh is round like a sphere 124 | 125 | Lighting = FALSE; 126 | 127 | //shaders 128 | VertexShader = NULL; 129 | PixelShader = NULL; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/IntegralTransform/Integral.cs: -------------------------------------------------------------------------------- 1 | //@author: sanch 2 | //@credits:tonfilm 3 | #region usings 4 | using System; 5 | using System.ComponentModel.Composition; 6 | using System.Collections.Generic; 7 | using SlimDX; 8 | using VVVV.PluginInterfaces.V1; 9 | using VVVV.PluginInterfaces.V2; 10 | using VVVV.Utils.VColor; 11 | using VVVV.Utils.VMath; 12 | using VVVV.Core.Logging; 13 | #endregion usings 14 | 15 | namespace VVVV.Nodes 16 | { 17 | #region PluginInfo 18 | [PluginInfo(Name = "Integral", Category = "Transform", Help = "Basic template with one transform in/out", Tags = "matrix")] 19 | #endregion PluginInfo 20 | public class Integral : IPluginEvaluate 21 | { 22 | #region fields & pins 23 | 24 | 25 | [Input("Transform In")] 26 | ISpread FTransformIn; 27 | 28 | [Input("Source")] 29 | ISpread> FInput; 30 | 31 | [Output("Transform")] 32 | ISpread> FOutput; 33 | #endregion fields & pins 34 | 35 | //called each frame by vvvv 36 | public void Evaluate(int SpreadMax) 37 | { 38 | FOutput.SliceCount = FInput.SliceCount; 39 | 40 | for (int b = 0; b < FInput.SliceCount; b++) { 41 | var inputSpread = FInput[b]; 42 | var outputSpread = FOutput[b]; 43 | 44 | outputSpread.SliceCount = inputSpread.SliceCount; 45 | 46 | outputSpread[0] = inputSpread[0] * FTransformIn[b]; 47 | 48 | for (int i = 1; i < inputSpread.SliceCount; i++) { 49 | outputSpread[i] = inputSpread[i] * outputSpread[i - 1]; 50 | 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/IntegralTransform/Integral.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {068A397D-134E-4B17-8EBC-F3721F2FE328} 4 | Debug 5 | x86 6 | Library 7 | Integral 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | C:\Users\gregsn\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis 18 | why 19 | 20 | 21 | Program 22 | 23 | 24 | 25 | ..\..\bin\managed\VVVV.PluginInterfaces.dll 26 | 27 | 28 | ..\..\bin\managed\SlimDX.dll 29 | 30 | 31 | 32 | ..\..\bin\managed\System.ComponentModel.Composition.dll 33 | 34 | 35 | 36 | ..\..\bin\managed\VVVV.Core.dll 37 | 38 | 39 | ..\..\bin\managed\VVVV.Utils.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/IntegralTransform/Integral.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | # SharpDevelop 3.2.0.5777 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Integral", "Integral.csproj", "{068A397D-134E-4B17-8EBC-F3721F2FE328}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|x86 = Debug|x86 10 | Debug|x86 = Debug|x86 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {068A397D-134E-4B17-8EBC-F3721F2FE328}.Debug|x86.Build.0 = Debug|x86 14 | {068A397D-134E-4B17-8EBC-F3721F2FE328}.Debug|x86.ActiveCfg = Debug|x86 15 | EndGlobalSection 16 | EndGlobal 17 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/IntegralTransform/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/IntegralTransform/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/integral-transform 2 | 3 | by sanch & tonfilm -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/Mandelbulb/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/mandelbulb 2 | 3 | by vux 4 | ported from Inigo Quilez (iq/rgba) -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/_advanced/QJuliaSet/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/documentation/tonfilm-patches#quaternion-julia-set 2 | 3 | by tonfilm -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/plugins/3dCubePyramid/3dCubePyramid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 5 | Debug 6 | x86 7 | Library 8 | VVVV.Nodes 9 | 3dCubePyramid 10 | v4.0 11 | bin\$(Platform)\$(Configuration)\ 12 | True 13 | ..\..\..\..\..\vvvv\vvvv_45beta33.7_x86\lib\core\;..\..\..\..\..\vvvv\vvvv_45beta33.7_x86\lib\nodes\plugins\ 14 | 15 | 16 | DEBUG;TRACE 17 | False 18 | True 19 | Full 20 | True 21 | 22 | 23 | TRACE 24 | True 25 | False 26 | None 27 | False 28 | 29 | 30 | AnyCPU 31 | 32 | 33 | x86 34 | 35 | 36 | x64 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/plugins/3dCubePyramid/C3dCubePyramidNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using System.Collections.Generic; 11 | 12 | using VVVV.Core.Logging; 13 | #endregion usings 14 | 15 | namespace VVVV.Nodes 16 | { 17 | #region PluginInfo 18 | [PluginInfo(Name = "CubePyramid", Category = "3d", Help = "Basic template with one value in/out", Tags = "")] 19 | #endregion PluginInfo 20 | public class C3dCubePyramidNode : IPluginEvaluate 21 | { 22 | #region fields & pins 23 | [Input("Scale", DefaultValue = 1.0)] 24 | public IDiffSpread FInScale; 25 | 26 | [Input("Iterations", DefaultValue = 1.0, IsSingle = true)] 27 | public IDiffSpread FInIterations; 28 | 29 | [Input("Scale Factor", DefaultValue = 1.0, IsSingle = true)] 30 | public IDiffSpread FInScaleFactor; 31 | 32 | [Output("Position XYZ")] 33 | public ISpread FOutPos; 34 | 35 | [Output("Scale")] 36 | public ISpread FOutScale; 37 | 38 | private List offsetVectors; 39 | 40 | private List cubesXYZ; 41 | private List cubesSize; 42 | 43 | [Import()] 44 | public ILogger FLogger; 45 | #endregion fields & pins 46 | 47 | public C3dCubePyramidNode() 48 | { 49 | offsetVectors = new List(); 50 | offsetVectors.Add(new Vector3D(-1,0,0)); //left 51 | offsetVectors.Add(new Vector3D(1,0,0)); //right 52 | offsetVectors.Add(new Vector3D(0,-1,0)); //down 53 | offsetVectors.Add(new Vector3D(0,1,0)); //up 54 | offsetVectors.Add(new Vector3D(0,0,-1)); //backward 55 | offsetVectors.Add(new Vector3D(0,0,1)); //forward 56 | } 57 | 58 | //called when data for any output pin is requested 59 | public void Evaluate(int SpreadMax) 60 | { 61 | if (FInIterations.IsChanged || FInScale.IsChanged || FInScaleFactor.IsChanged) 62 | { 63 | cubesXYZ = new List(); 64 | cubesSize = new List(); 65 | 66 | int iterationCounter = 0; 67 | GenerateCubes(new Vector3D(0,0,0), FInScale[0], iterationCounter); 68 | 69 | FOutPos.AssignFrom(cubesXYZ); 70 | FOutScale.AssignFrom(cubesSize); 71 | } 72 | } 73 | 74 | private void GenerateCubes(Vector3D center, double size, int iterationLevel) 75 | { 76 | if (iterationLevel <= FInIterations[0]) 77 | { 78 | cubesXYZ.Add(center); 79 | cubesSize.Add(size); 80 | 81 | iterationLevel++; 82 | foreach (Vector3D oV in offsetVectors) 83 | { 84 | GenerateCubes(center + oV * size*FInScaleFactor[0], size*FInScaleFactor[0], iterationLevel); 85 | } 86 | } 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/plugins/3dCubePyramid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/plugins/KochCurve2d/KochCurve2d.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 5 | Debug 6 | x86 7 | Library 8 | VVVV.Nodes 9 | KochCurve2d 10 | v4.0 11 | bin\$(Platform)\$(Configuration)\ 12 | True 13 | ..\..\..\..\..\vvvv\vvvv_45beta33.7_x86\lib\core\;..\..\..\..\..\vvvv\vvvv_45beta33.7_x86\lib\nodes\plugins\ 14 | 15 | 16 | DEBUG;TRACE 17 | False 18 | True 19 | Full 20 | True 21 | 22 | 23 | TRACE 24 | True 25 | False 26 | None 27 | False 28 | 29 | 30 | AnyCPU 31 | 32 | 33 | x86 34 | 35 | 36 | x64 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/plugins/KochCurve2d/KochCurve2dNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using System.Collections.Generic; 6 | 7 | using VVVV.PluginInterfaces.V1; 8 | using VVVV.PluginInterfaces.V2; 9 | using VVVV.Utils.VColor; 10 | using VVVV.Utils.VMath; 11 | 12 | using VVVV.Core.Logging; 13 | #endregion usings 14 | 15 | namespace VVVV.Nodes 16 | { 17 | #region PluginInfo 18 | [PluginInfo(Name = "KochCurve", Category = "2d", Tags = "fractal, recursion")] 19 | #endregion PluginInfo 20 | public class KochCurve2dNode : IPluginEvaluate 21 | { 22 | #region fields & pins 23 | [Input("Input", DefaultValues = new double[] {0.0,0.0})] 24 | public IDiffSpread FInput; 25 | 26 | [Input("Iterations", DefaultValue = 1, MinValue = 1, IsSingle = true)] 27 | public IDiffSpread FIterations; 28 | 29 | [Output("Output")] 30 | public ISpread FOutput; 31 | 32 | [Import()] 33 | public ILogger FLogger; 34 | #endregion fields & pins 35 | 36 | //called when data for any output pin is requested 37 | public void Evaluate(int SpreadMax) 38 | { 39 | if (FInput.IsChanged || FIterations.IsChanged) 40 | { 41 | FOutput.AssignFrom(FInput); 42 | 43 | for (int i = 0; i < FIterations[0]; i++) { 44 | int segCount = FOutput.SliceCount - 1; 45 | for (int k = 0; k < segCount*4; k=k+4) { 46 | 47 | Vector2D segStart = FOutput[k]; 48 | Vector2D segEnd = FOutput[k + 1]; 49 | Vector2D segThird = (segEnd - segStart) / 3; 50 | 51 | FOutput.Insert(k+1, segStart + segThird); 52 | FOutput.Insert(k+2, segStart + segThird + (VMath.RotateZ(VMath.DegToRad * 60) * segThird).xy); 53 | FOutput.Insert(k+3, segStart + 2 * segThird); 54 | 55 | } 56 | 57 | } 58 | 59 | } 60 | 61 | } 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /02_Feedback/02_Recursion/plugins/KochCurve2d/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("KochCurve2d")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("KochCurve2dPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2015")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /02_Feedback/03_Droste/_Droste.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/02_Feedback/03_Droste/_Droste.jpg -------------------------------------------------------------------------------- /02_Feedback/03_Droste/_Hogan_Droste.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/02_Feedback/03_Droste/_Hogan_Droste.jpg -------------------------------------------------------------------------------- /02_Feedback/03_Droste/droste/Bicubic.fxh: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------- 2 | // PARAMETERS: 3 | // -------------------------------------------------------------------------------------------------- 4 | 5 | //texture size XY 6 | float2 size_source; 7 | 8 | //filter texture 9 | texture TexFilter ; 10 | 11 | //filter sampler 12 | sampler1D SampFilter = sampler_state 13 | { 14 | Texture = (TexFilter); //apply a texture to the sampler 15 | MipFilter = linear; //sampler states 16 | MinFilter = linear; 17 | MagFilter = linear; 18 | addressU = wrap; 19 | addressV = wrap; 20 | }; 21 | 22 | //texture lookup 23 | float4 tex2Dbicubic(sampler s, float2 tex) 24 | { 25 | 26 | //pixel size XY 27 | float2 pix = 1.0/size_source; 28 | 29 | //calc filter texture coordinates 30 | float2 w = tex*size_source-float2(0.5, 0.5); 31 | 32 | // fetch offsets and weights from filter function 33 | float3 hg_x = tex1D(SampFilter, w.x ).xyz; 34 | float3 hg_y = tex1D(SampFilter, w.y ).xyz; 35 | 36 | float2 e_x = {pix.x, 0}; 37 | float2 e_y = {0, pix.y}; 38 | 39 | // determine linear sampling coordinates 40 | float2 coord_source10 = tex + hg_x.x * e_x; 41 | float2 coord_source00 = tex - hg_x.y * e_x; 42 | float2 coord_source11 = coord_source10 + hg_y.x * e_y; 43 | float2 coord_source01 = coord_source00 + hg_y.x * e_y; 44 | coord_source10 = coord_source10 - hg_y.y * e_y; 45 | coord_source00 = coord_source00 - hg_y.y * e_y; 46 | 47 | // fetch four linearly interpolated inputs 48 | float4 tex_source00 = tex2D( s, coord_source00 ); 49 | float4 tex_source10 = tex2D( s, coord_source10 ); 50 | float4 tex_source01 = tex2D( s, coord_source01 ); 51 | float4 tex_source11 = tex2D( s, coord_source11 ); 52 | 53 | // weight along y direction 54 | tex_source00 = lerp( tex_source00, tex_source01, hg_y.z ); 55 | tex_source10 = lerp( tex_source10, tex_source11, hg_y.z ); 56 | 57 | // weight along x direction 58 | tex_source00 = lerp( tex_source00, tex_source10, hg_x.z ); 59 | 60 | return tex_source00; 61 | } 62 | 63 | // ------------------------------------------------------------------------- 64 | 65 | -------------------------------------------------------------------------------- /02_Feedback/03_Droste/droste/BicubicFilterKernel.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/02_Feedback/03_Droste/droste/BicubicFilterKernel.hdr -------------------------------------------------------------------------------- /02_Feedback/03_Droste/droste/Droste.fx: -------------------------------------------------------------------------------- 1 | //@author: tonfilm 2 | //@help: an infinite zoom into an image. 3 | //@tags: escher 4 | //@credits: Dag Ågren 5 | 6 | // -------------------------------------------------------------------------------------------------- 7 | // PARAMETERS: 8 | // -------------------------------------------------------------------------------------------------- 9 | 10 | //transforms 11 | float4x4 tW: WORLD; //the models world matrix 12 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 13 | float4x4 tP: PROJECTION; 14 | float4x4 tWVP: WORLDVIEWPROJECTION; 15 | 16 | //texture 17 | texture Tex ; 18 | sampler Samp = sampler_state //sampler for doing the texture-lookup 19 | { 20 | Texture = (Tex); //apply a texture to the sampler 21 | MipFilter = LINEAR; //sampler states 22 | MinFilter = LINEAR; 23 | MagFilter = LINEAR; 24 | }; 25 | 26 | //texture transformation marked with semantic TEXTUREMATRIX to achieve symmetric transformations 27 | float4x4 tTex: TEXTUREMATRIX ; 28 | 29 | //the data structure: "vertexshader to pixelshader" 30 | //used as output data with the VS function 31 | //and as input data with the PS function 32 | struct vs2ps 33 | { 34 | float4 Pos : POSITION; 35 | float2 TexCd : TEXCOORD0; 36 | }; 37 | 38 | // -------------------------------------------------------------------------------------------------- 39 | // VERTEXSHADERS 40 | // -------------------------------------------------------------------------------------------------- 41 | vs2ps VS( 42 | float4 PosO : POSITION, 43 | float4 TexCd : TEXCOORD0) 44 | { 45 | //declare output struct 46 | vs2ps Out; 47 | 48 | //transform position 49 | Out.Pos = mul(PosO, tWVP); 50 | 51 | //transform texturecoordinates 52 | Out.TexCd = mul(TexCd, tTex); 53 | 54 | return Out; 55 | } 56 | 57 | // -------------------------------------------------------------------------------------------------- 58 | // PIXELSHADERS: 59 | // -------------------------------------------------------------------------------------------------- 60 | 61 | #include "bicubic.fxh" 62 | 63 | #define pi 3.1415926535 64 | 65 | float2 center; 66 | float2 t; 67 | int2 p=1; 68 | float logbase = 0.2; 69 | 70 | float4 PS(vs2ps In): COLOR 71 | { 72 | 73 | float lo = 1/logbase; 74 | float2 tc = In.TexCd - center; 75 | 76 | float u_corner=2.0*pi*p.y; 77 | float v_corner=lo*p.x; 78 | float diag=sqrt(u_corner*u_corner+v_corner*v_corner); 79 | 80 | float sin_a=v_corner/diag; 81 | float cos_a=u_corner/diag; 82 | float scale=diag/2.0/pi; 83 | 84 | float a=atan2(-tc.y,tc.x); 85 | float r=sqrt(tc.x*tc.x+tc.y*tc.y); 86 | 87 | float fu=a; 88 | float fv=log(r); 89 | 90 | float tmp=(fu*cos_a+fv*sin_a)*scale; 91 | fv=(-fu*sin_a+fv*cos_a)*scale; 92 | fu=tmp; 93 | 94 | fu/=2.0*pi; 95 | fv/=lo; 96 | 97 | float4 col = tex2Dbicubic(Samp,float2(fu,fv) - t); 98 | return col; 99 | } 100 | 101 | // -------------------------------------------------------------------------------------------------- 102 | // TECHNIQUES: 103 | // -------------------------------------------------------------------------------------------------- 104 | 105 | technique TDroste 106 | { 107 | pass P0 108 | { 109 | //Wrap0 = U; // useful when mesh is round like a sphere 110 | VertexShader = compile vs_3_0 VS(); 111 | PixelShader = compile ps_3_0 PS(); 112 | } 113 | } 114 | 115 | technique TFixedFunction 116 | { 117 | pass P0 118 | { 119 | //transforms 120 | WorldTransform[0] = (tW); 121 | ViewTransform = (tV); 122 | ProjectionTransform = (tP); 123 | 124 | //texturing 125 | Sampler[0] = (Samp); 126 | TextureTransform[0] = (tTex); 127 | TexCoordIndex[0] = 0; 128 | TextureTransformFlags[0] = COUNT2; 129 | //Wrap0 = U; // useful when mesh is round like a sphere 130 | 131 | Lighting = FALSE; 132 | 133 | //shaders 134 | VertexShader = NULL; 135 | PixelShader = NULL; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /02_Feedback/03_Droste/droste/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/droste 2 | 3 | by tonfilm -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/plane-curves 2 | 3 | by fibo -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dBifolium/2dBifolium.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 4 | Debug 5 | x86 6 | Library 7 | VVVV.Nodes 8 | 2dBifolium 9 | v3.5 10 | bin\Debug\ 11 | True 12 | Full 13 | False 14 | True 15 | DEBUG;TRACE 16 | $(VVVV45)\bin\managed\ 17 | $(VVVV45)\vvvv.exe 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dBifolium/C2dBifoliumNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "Bifolium", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class Bifolium : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("A", DefaultValue = 1.0)] 22 | ISpread FInputA; 23 | [Input("T", DefaultValue = 0.0)] 24 | ISpread FInputT; 25 | 26 | [Output("Output X")] 27 | ISpread FOutputX; 28 | [Output("Output Y")] 29 | ISpread FOutputY; 30 | 31 | [Import()] 32 | ILogger Flogger; 33 | #endregion fields & pins 34 | 35 | //called when data for any output pin is requested 36 | public void Evaluate(int SpreadMax) 37 | { 38 | FOutputX.SliceCount = SpreadMax; 39 | FOutputY.SliceCount = SpreadMax; 40 | 41 | for (int i = 0; i < SpreadMax; i++) 42 | { 43 | FOutputX[i] = (4 * FInputA[i] * Math.Sin(FInputT[i]) * Math.Sin(FInputT[i]) * Math.Cos(FInputT[i])) * Math.Cos(FInputT[i]); 44 | FOutputY[i] = (4 * FInputA[i] * Math.Sin(FInputT[i]) * Math.Sin(FInputT[i]) * Math.Cos(FInputT[i])) * Math.Sin(FInputT[i]); 45 | } 46 | 47 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dBifolium/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dLemniscateOfGerono/2dLemniscateOfGerono.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 4 | Debug 5 | x86 6 | Library 7 | VVVV.Nodes 8 | 2dLemniscateOfGerono 9 | v3.5 10 | bin\Debug\ 11 | True 12 | Full 13 | False 14 | True 15 | DEBUG;TRACE 16 | $(VVVV45)\bin\managed\ 17 | $(VVVV45)\vvvv.exe 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dLemniscateOfGerono/C2dLemniscateOfGeronoNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "LemniscateOfGerono", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class C2dLemniscateOfGeronoNode : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("A", DefaultValue = 1.0)] 22 | ISpread FInputA; 23 | [Input("B", DefaultValue = 1.0)] 24 | ISpread FInputB; 25 | [Input("T", DefaultValue = 0.0)] 26 | ISpread FInputT; 27 | 28 | [Output("Output X")] 29 | ISpread FOutputX; 30 | [Output("Output Y")] 31 | ISpread FOutputY; 32 | 33 | [Import()] 34 | ILogger Flogger; 35 | #endregion fields & pins 36 | 37 | //called when data for any output pin is requested 38 | public void Evaluate(int SpreadMax) 39 | { 40 | FOutputX.SliceCount = SpreadMax; 41 | FOutputY.SliceCount = SpreadMax; 42 | 43 | for (int i = 0; i < SpreadMax; i++) { 44 | FOutputX[i] = FInputA[i]*Math.Cos(FInputT[i]); 45 | FOutputY[i] = FInputB[i]*Math.Cos(FInputT[i]) * Math.Sin(FInputT[i]); 46 | } 47 | 48 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dLemniscateOfGerono/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dNephroid/2dNephroid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 4 | Debug 5 | x86 6 | Library 7 | VVVV.Nodes 8 | 2dNephroid 9 | v3.5 10 | bin\Debug\ 11 | True 12 | Full 13 | False 14 | True 15 | DEBUG;TRACE 16 | $(VVVV45)\bin\managed\ 17 | $(VVVV45)\vvvv.exe 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dNephroid/C2dNephroidNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "Nephroid", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class Nephroid : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("A", DefaultValue = 1.0)] 22 | ISpread FInputA; 23 | [Input("B", DefaultValue = 3.0)] 24 | ISpread FInputB; 25 | [Input("C", DefaultValue = 3.0)] 26 | ISpread FInputC; 27 | [Input("T", DefaultValue = 0.0)] 28 | ISpread FInputT; 29 | 30 | [Output("Output X")] 31 | ISpread FOutputX; 32 | [Output("Output Y")] 33 | ISpread FOutputY; 34 | 35 | [Import()] 36 | ILogger Flogger; 37 | #endregion fields & pins 38 | 39 | //called when data for any output pin is requested 40 | public void Evaluate(int SpreadMax) 41 | { 42 | FOutputX.SliceCount = SpreadMax; 43 | FOutputY.SliceCount = SpreadMax; 44 | 45 | for (int i = 0; i < SpreadMax; i++) 46 | { 47 | FOutputX[i] = FInputA[i]*(FInputB[i]*Math.Cos(FInputT[i])-Math.Cos(FInputB[i]*FInputT[i])); 48 | FOutputY[i] = FInputA[i]*(FInputC[i]*Math.Sin(FInputT[i])-Math.Sin(FInputC[i]*FInputT[i])); 49 | } 50 | 51 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dNephroid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dRhodonea/2dRhodonea.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 4 | Debug 5 | x86 6 | Library 7 | VVVV.Nodes 8 | 2dRhodonea 9 | v3.5 10 | bin\Debug\ 11 | True 12 | Full 13 | False 14 | True 15 | DEBUG;TRACE 16 | $(VVVV45)\bin\managed\ 17 | $(VVVV45)\vvvv.exe 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dRhodonea/C2dRhodoneaNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "Rhodonea", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class C2dRhodoneaNode : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("A", DefaultValue = 7.0)] 22 | ISpread FInputA; 23 | [Input("B", DefaultValue = 1.0)] 24 | ISpread FInputB; 25 | [Input("T", DefaultValue = 0.0)] 26 | ISpread FInputT; 27 | 28 | [Output("Output X")] 29 | ISpread FOutputX; 30 | [Output("Output Y")] 31 | ISpread FOutputY; 32 | 33 | [Import()] 34 | ILogger Flogger; 35 | #endregion fields & pins 36 | 37 | //called when data for any output pin is requested 38 | public void Evaluate(int SpreadMax) 39 | { 40 | FOutputX.SliceCount = SpreadMax; 41 | FOutputY.SliceCount = SpreadMax; 42 | 43 | for (int i = 0; i < SpreadMax; i++) { 44 | FOutputX[i] = FInputA[i] * Math.Sin(FInputB[i] * FInputT[i]) * Math.Cos(FInputT[i]); 45 | FOutputY[i] = FInputA[i] * Math.Sin(FInputB[i] * FInputT[i]) * Math.Sin(FInputT[i]); 46 | } 47 | 48 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/2dRhodonea/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Hypocycloid/Hypocycloid.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usingR 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "Hypocycloid", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class Hypocycloid : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("Input A", DefaultValue = 1.0)] 22 | ISpread FInputA; 23 | 24 | [Input("Input B", DefaultValue = 3.0)] 25 | ISpread FInputB; 26 | 27 | [Input("Time", DefaultValue = 0)] 28 | ISpread FInputT; 29 | 30 | [Output("Output X")] 31 | ISpread FOutputX; 32 | 33 | [Output("Output Y")] 34 | ISpread FOutputY; 35 | 36 | [Import()] 37 | ILogger Flogger; 38 | #endregion fields & pins 39 | 40 | //called when data for any output pin is requested 41 | public void Evaluate(int SpreadMax) 42 | { 43 | FOutputX.SliceCount = SpreadMax; 44 | FOutputY.SliceCount = SpreadMax; 45 | 46 | for (int i = 0; i < SpreadMax; i++) { 47 | FOutputX[i] = (FInputA[i] - FInputB[i]) * Math.Cos(FInputT[i]) - FInputB[i] * Math.Cos((FInputA[i]/FInputB[i] - 1) * FInputT[i]); 48 | FOutputY[i] = (FInputA[i] - FInputB[i]) * Math.Sin(FInputT[i]) - FInputB[i] * Math.Sin((FInputA[i]/FInputB[i] - 1) * FInputT[i]); 49 | } 50 | 51 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Hypocycloid/Hypocycloid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {66E9B759-FF01-40A0-85D2-4C1793A52558} 4 | Debug 5 | x86 6 | Library 7 | Hypocycloid 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | 18 | 19 | 20 | $(VVVV45)\bin\managed\VVVV.PluginInterfaces.dll 21 | 22 | 23 | 24 | $(VVVV45)\bin\managed\System.ComponentModel.Composition.dll 25 | 26 | 27 | 28 | $(VVVV45)\bin\managed\VVVV.Core.dll 29 | 30 | 31 | $(VVVV45)\bin\managed\VVVV.Utils.dll 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Hypocycloid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Hypotrochoid/Hypotrochoid.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "Hypotrochoid", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class Hypotrochoid : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("A", DefaultValue = 7.0)] 22 | ISpread FInputA; 23 | [Input("B", DefaultValue = 1.0)] 24 | ISpread FInputB; 25 | [Input("C", DefaultValue = 1.0)] 26 | ISpread FInputC; 27 | [Input("T", DefaultValue = 0.0)] 28 | ISpread FInputT; 29 | 30 | [Output("Output X")] 31 | ISpread FOutputX; 32 | [Output("Output Y")] 33 | ISpread FOutputY; 34 | 35 | [Import()] 36 | ILogger Flogger; 37 | #endregion fields & pins 38 | 39 | //called when data for any output pin is requested 40 | public void Evaluate(int SpreadMax) 41 | { 42 | FOutputX.SliceCount = SpreadMax; 43 | FOutputY.SliceCount = SpreadMax; 44 | 45 | for (int i = 0; i < SpreadMax; i++) 46 | { 47 | FOutputX[i] = (FInputA[i] - FInputB[i])*Math.Cos(FInputT[i])+FInputC[i]*Math.Cos(((FInputA[i] - FInputB[i])/FInputB[i])*FInputT[i]); 48 | FOutputY[i] = (FInputA[i] - FInputB[i])*Math.Sin(FInputT[i])-FInputC[i]*Math.Sin(((FInputA[i] - FInputB[i])/FInputB[i])*FInputT[i]); 49 | } 50 | 51 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Hypotrochoid/Hypotrochoid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {2C82ECB4-3F2B-4D5D-B588-871E9A38D987} 4 | Debug 5 | x86 6 | Library 7 | Hypotrochoid 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | 18 | 19 | 20 | $(VVVV45)\bin\managed\VVVV.PluginInterfaces.dll 21 | 22 | 23 | 24 | $(VVVV45)\bin\managed\System.ComponentModel.Composition.dll 25 | 26 | 27 | 28 | $(VVVV45)\bin\managed\VVVV.Core.dll 29 | 30 | 31 | $(VVVV45)\bin\managed\VVVV.Utils.dll 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Hypotrochoid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/LimaconOfPascal/LimaconOfPascal.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "LimaconOfPascal", Category = "2d", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class LimaconOfPascal : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("Input A", DefaultValue = 1.0)] 22 | ISpread FInputA; 23 | 24 | [Input("Input B", DefaultValue = 1.0)] 25 | ISpread FInputB; 26 | 27 | [Input("Time", DefaultValue = 0)] 28 | ISpread FInputT; 29 | 30 | [Output("Output X")] 31 | ISpread FOutputX; 32 | 33 | [Output("Output Y")] 34 | ISpread FOutputY; 35 | 36 | [Import()] 37 | ILogger Flogger; 38 | #endregion fields & pins 39 | 40 | //called when data for any output pin is requested 41 | public void Evaluate(int SpreadMax) 42 | { 43 | FOutputX.SliceCount = SpreadMax; 44 | FOutputY.SliceCount = SpreadMax; 45 | 46 | for (int i = 0; i < SpreadMax; i++) { 47 | FOutputX[i] = (FInputB[i] + FInputA[i] * Math.Cos(FInputT[i])) * Math.Cos(FInputT[i]); 48 | FOutputY[i] = (FInputB[i] + FInputA[i] * Math.Cos(FInputT[i])) * Math.Sin(FInputT[i]); 49 | } 50 | 51 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/LimaconOfPascal/LimaconOfPascal.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {59DDF4F0-FB69-4E33-8ADD-5E5DD3BD61E4} 4 | Debug 5 | x86 6 | Library 7 | LimaconOfPascal 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | 18 | 19 | 20 | $(VVVV45)\bin\managed\VVVV.PluginInterfaces.dll 21 | 22 | 23 | 24 | $(VVVV45)\bin\managed\System.ComponentModel.Composition.dll 25 | 26 | 27 | 28 | $(VVVV45)\bin\managed\VVVV.Core.dll 29 | 30 | 31 | $(VVVV45)\bin\managed\VVVV.Utils.dll 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/LimaconOfPascal/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Spiral2d/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Spiral2d/Spiral2d.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.ComponentModel.Composition; 4 | 5 | using VVVV.PluginInterfaces.V1; 6 | using VVVV.PluginInterfaces.V2; 7 | using VVVV.Utils.VColor; 8 | using VVVV.Utils.VMath; 9 | 10 | using VVVV.Core.Logging; 11 | #endregion usings 12 | 13 | namespace VVVV.Nodes 14 | { 15 | #region PluginInfo 16 | [PluginInfo(Name = "Spiral", Category = "2d", Version = "Equiangular", Author = "fibo", Help = "Plane curve", Tags = "2d,curve")] 17 | #endregion PluginInfo 18 | public class Spiral : IPluginEvaluate 19 | { 20 | #region fields & pins 21 | [Input("Input A", DefaultValue = 1.0)] 22 | ISpread FInputA; 23 | 24 | [Input("Input B", DefaultValue = 1.0)] 25 | ISpread FInputB; 26 | 27 | [Input("Time", DefaultValue = 0)] 28 | ISpread FInputT; 29 | 30 | [Output("Output X")] 31 | ISpread FOutputX; 32 | 33 | [Output("Output Y")] 34 | ISpread FOutputY; 35 | 36 | [Import()] 37 | ILogger Flogger; 38 | #endregion fields & pins 39 | 40 | //called when data for any output pin is requested 41 | public void Evaluate(int SpreadMax) 42 | { 43 | FOutputX.SliceCount = SpreadMax; 44 | FOutputY.SliceCount = SpreadMax; 45 | 46 | for (int i = 0; i < SpreadMax; i++) { 47 | FOutputX[i] = FInputA[i] * Math.Exp(FInputT[i] / Math.Tan(FInputB[i]) ) * Math.Cos(FInputT[i]); 48 | FOutputY[i] = FInputA[i] * Math.Exp(FInputT[i] / Math.Tan(FInputB[i]) ) * Math.Sin(FInputT[i]); 49 | } 50 | 51 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /03_Math/02_Trigonometry/_advanced/PlaneCurves/plugins/Spiral2d/Spiral2d.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {F7B005A9-C044-4E0E-954E-110D070A4058} 4 | Debug 5 | x86 6 | Library 7 | Spiral2d 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | 18 | 19 | 20 | $(VVVV45)\bin\managed\VVVV.PluginInterfaces.dll 21 | 22 | 23 | 24 | $(VVVV45)\bin\managed\System.ComponentModel.Composition.dll 25 | 26 | 27 | 28 | $(VVVV45)\bin\managed\VVVV.Core.dll 29 | 30 | 31 | $(VVVV45)\bin\managed\VVVV.Utils.dll 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /03_Math/04_2dTo3d/_advanced/superformula 2d 3d/_credits.txt: -------------------------------------------------------------------------------- 1 | by sanch -------------------------------------------------------------------------------- /03_Math/06_3dShapes/_advanced/P_Q/Constant_Torus_P_Q.fx: -------------------------------------------------------------------------------- 1 | //P-Q_Torus 2 | //Shader by Digital Slaves 3 | 4 | // -------------------------------------------------------------------------------------------------- 5 | // PARAMETERS: 6 | // -------------------------------------------------------------------------------------------------- 7 | 8 | //transforms 9 | float4x4 tW: WORLD; 10 | float4x4 tV: VIEW; 11 | float4x4 tP: PROJECTION; 12 | float4x4 tWVP: WORLDVIEWPROJECTION; 13 | float4x4 tWV: WORLDVIEW; 14 | 15 | #define TwoPi 6.28318531 16 | #define Pi 3.14159265 17 | 18 | float gridOffsetX; 19 | float gridOffsetY; 20 | float gridScaleX = 1; 21 | float gridScaleY = 1; 22 | 23 | //Tweak 24 | int P; 25 | int Q; 26 | int E; 27 | 28 | float4 cAmb : COLOR = {1, 1, 1, 1}; 29 | 30 | //Texture 31 | texture Tex ; 32 | sampler Samp = sampler_state //sampler for doing the texture-lookup 33 | { 34 | Texture = (Tex); //apply a texture to the sampler 35 | MipFilter = LINEAR; //sampler states 36 | MinFilter = LINEAR; 37 | MagFilter = LINEAR; 38 | }; 39 | 40 | 41 | //P_Q Shape Function 42 | 43 | float3 P_Q_Torus(float u, float v) 44 | { 45 | float r = 0.5 * (2 + (sin (E * u * v))) ; 46 | 47 | //Try 48 | 49 | //Add : int F; 50 | //float r = 0.5 * (F + (sin (E * u * v))) ; 51 | 52 | float x = r * cos (P * u * v); 53 | float y = r * cos (Q * u * v); 54 | float z = (r * sin (P * u * v)); 55 | 56 | return float3(x, y, z); 57 | } 58 | 59 | 60 | struct vs2ps 61 | { 62 | float4 Pos : POSITION; 63 | float4 TexCd : TEXCOORD0; 64 | float2 UV : TEXCOORD2; 65 | 66 | }; 67 | 68 | // -------------------------------------------------------------------------------------------------- 69 | // VERTEXSHADERS 70 | // -------------------------------------------------------------------------------------------------- 71 | 72 | vs2ps VS( 73 | 74 | float4 Pos : POSITION, 75 | float4 TexCd : TEXCOORD0) 76 | 77 | { 78 | vs2ps Out = (vs2ps)0; 79 | 80 | float u, v; 81 | 82 | gridScaleX *= Pi; 83 | gridScaleY *= TwoPi; 84 | 85 | u = (Pos.x + gridOffsetX) * gridScaleX; 86 | v = (Pos.y + gridOffsetY) * gridScaleY; 87 | 88 | Pos.xyz = P_Q_Torus(u, v); 89 | Pos.w = 1; 90 | 91 | Out.Pos = mul(Pos, tWVP); 92 | Out.UV = float2(u, v); 93 | Out.TexCd = TexCd; 94 | 95 | return Out; 96 | } 97 | 98 | // -------------------------------------------------------------------------------------------------- 99 | // PIXELSHADERS: 100 | // -------------------------------------------------------------------------------------------------- 101 | 102 | float4 PS(vs2ps In): COLOR 103 | { 104 | 105 | float4 col = tex2D(Samp, In.TexCd) * cAmb; 106 | 107 | return col; 108 | 109 | } 110 | 111 | // -------------------------------------------------------------------------------------------------- 112 | // TECHNIQUES: 113 | // -------------------------------------------------------------------------------------------------- 114 | 115 | technique TP_Q_Torus 116 | { 117 | pass P0 118 | { 119 | 120 | VertexShader = compile vs_1_0 VS(); 121 | PixelShader = compile ps_1_0 PS(); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /03_Math/06_3dShapes/_advanced/P_Q/_credits.txt: -------------------------------------------------------------------------------- 1 | by Digital Slaves -------------------------------------------------------------------------------- /03_Math/06_3dShapes/_advanced/Surfaces_simple/_credits.txt: -------------------------------------------------------------------------------- 1 | by desaxismundis, sanch & tonfilm -------------------------------------------------------------------------------- /03_Math/06_3dShapes/_advanced/Surfaces_simple/content.txt: -------------------------------------------------------------------------------- 1 | ____Surfaces_01___________ 2 | -Paraboloid 3 | -Hyperboloid 4 | -LimpetTorus 5 | -Handkerchief 6 | -Apple 7 | -Springs 8 | -Figure8Torus 9 | -EllipticTorus 10 | -Catenoid 11 | -Kidney 12 | ____Surfaces_02___________ 13 | -SteinbachScrew 14 | -Sine 15 | -Eight 16 | -Corkscrew 17 | -Roman2Boy 18 | -TwistedPipe 19 | -BohemianDome 20 | -Folium 21 | -AstroidalEllipsoid 22 | -TriaxialHexatorus 23 | ____Surfaces_03___________ 24 | -sphere 25 | -CrossCap 26 | -Bow 27 | -Tear 28 | -Moebius 29 | -Horn 30 | -Cresent 31 | -Shell 32 | -PisotTriaxial 33 | -Hyperhelicoid 34 | ____Surfaces_04___________ 35 | -Scherk 36 | -Dini 37 | -Helicoid 38 | -Bour 39 | -Catalan 40 | -Fish 41 | -DoubleCone 42 | -TriaxialTeardrop 43 | -Jet 44 | ____Surfaces_05___________ 45 | -BentHorns 46 | -Ennepers 47 | -Pillow 48 | -MonkeySaddle 49 | -Henneburg 50 | -Snail 51 | -Lemniscape 52 | -Tranguloid 53 | -Cone 54 | ____Surfaces_06___________ 55 | -Stiletto 56 | -MaedersOwl 57 | -TriaxialTritorus 58 | -Tear 59 | -Slippers 60 | -Kuen 61 | -KleinCycloid 62 | -KleinBottle 63 | -Tractrix 64 | -Helicoid -------------------------------------------------------------------------------- /03_Math/06_3dShapes/_advanced/superformula/_credits.txt: -------------------------------------------------------------------------------- 1 | by sanch -------------------------------------------------------------------------------- /03_Math/06_3dShapes/_advanced/superformula/superformula phong directionnal.fx: -------------------------------------------------------------------------------- 1 | 2 | float4x4 tW: WORLD; //the models world matrix 3 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 4 | float4x4 tP: PROJECTION; 5 | float4x4 tVP: VIEWPROJECTION; 6 | float4x4 tWVP: WORLDVIEWPROJECTION; 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 TT ; 9 | float3 lDir = {0, -5, 2}; //light direction in world space 10 | float4 lAmb : COLOR = {0.15, 0.15, 0.15, 1}; 11 | float4 lDiff : COLOR = {0.85, 0.85, 0.85, 1}; 12 | float4 lSpec : COLOR = {0.35, 0.35, 0.35, 1}; 13 | float lPower = 25.0; //shininess of specular highlight 14 | 15 | texture Tex ; 16 | sampler Samp = sampler_state //sampler for doing the texture-lookup 17 | { 18 | Texture = (Tex); //apply a texture to the sampler 19 | MipFilter = LINEAR; //sampler states 20 | MinFilter = LINEAR; 21 | MagFilter = LINEAR; 22 | }; 23 | 24 | //texture transformation marked with semantic TEXTUREMATRIX to achieve 25 | //symmetric transformations 26 | float4x4 tTex: TEXTUREMATRIX ; 27 | 28 | //the data structure: "vertexshader to pixelshader" 29 | //used as output data with the VS function 30 | //and as input data with the PS function 31 | 32 | 33 | 34 | struct vs2ps 35 | { 36 | float4 Pos : POSITION; 37 | float2 TexCd : TEXCOORD0; 38 | float4 TexCol : TEXCOORD1; 39 | float4 PosV : TEXCOORD2; 40 | float3 ViewDirV: TEXCOORD3; 41 | float3 LightDirV: TEXCOORD4; 42 | float4 Bi : TEXCOORD5; 43 | float4 Tan : TEXCOORD6; 44 | }; 45 | // 46 | //---------------------------------------------------------------------------- 47 | //---------------------- 48 | // VERTEXSHADERS 49 | // 50 | //---------------------------------------------------------------------------- 51 | //---------------------- 52 | struct pd 53 | { 54 | float p; 55 | float d; //derivative 56 | }; 57 | pd supaformula(float m, float n1, float n2, float n3, float phi) 58 | { 59 | float2 ret; 60 | float r; 61 | float a=1, b=1; 62 | float t1___ = cos(m * phi / 4); 63 | float t1__ = t1___ / a; 64 | float t1_ = abs(t1__); 65 | float t1 = pow(t1_, n2); 66 | float t2___ = sin(m * phi / 4); 67 | float t2__ = t2___ / b; 68 | float t2_ = abs(t2__); 69 | float t2 = pow(t2_, n3); 70 | float T = t1+t2; 71 | r = pow(T, 1/n1); 72 | if (abs(r) == 0) { 73 | r = 0; 74 | } else { 75 | r = 1 / r; 76 | } 77 | float dt1 = n2 * (t1/t1_) * sign(t1__) * (- m * t2___ / (4 * a)); 78 | float dt2 = n3 * (t2/t2_) * sign(t2__) * ( m * t1___ / (4 * b)); 79 | float dT = dt1 + dt2; 80 | pd Out; 81 | Out.p = r; 82 | Out.d = - (1/n1) * (r/T) * dT; 83 | return Out; 84 | } 85 | float2 supaformula2D(float m, float n1, float n2, float n3, float phi) 86 | { 87 | float2 ret; 88 | float r; 89 | float t1,t2; 90 | float a=1, b=1; 91 | t1 = cos(m * phi / 4) / a; 92 | t1 = abs(t1); 93 | t1 = pow(t1,n2); 94 | t2 = sin(m * phi / 4) / b; 95 | t2 = abs(t2); 96 | t2 = pow(t2,n3); 97 | r = pow(t1+t2, 1/n1); 98 | 99 | if (abs(r) == 0) { 100 | ret = 0; 101 | } else { 102 | r = 1 / r; 103 | ret.x = r * cos(phi); 104 | ret.y = r * sin(phi); 105 | } 106 | 107 | return ret; 108 | } 109 | struct PosBiTan 110 | { 111 | float3 Pos; 112 | float3 Bi; 113 | float3 Tan; 114 | }; 115 | PosBiTan sfs3D(float m, float n1, float n2, float n3,float mb, float n1b, float n2b, float n3b, float theta, float 116 | phi){ 117 | pd rt = supaformula(m, n1, n2, n3, theta); 118 | pd rp = supaformula(mb, n1b, n2b, n3b, phi); 119 | float st = sin(theta); 120 | float ct = cos(theta); 121 | float sp = sin(phi); 122 | float cp = cos(phi); 123 | 124 | PosBiTan Out; 125 | Out.Pos.x = rt.p * ct * rp.p * cp; 126 | Out.Pos.y = rt.p * st * rp.p * cp; 127 | Out.Pos.z = rp.p * sp; 128 | 129 | Out.Bi.x = (rt.d*ct-rt.p*st) * (rp.p * cp); 130 | Out.Bi.y = (rt.d*st+rt.p*ct) * (rp.p * cp); 131 | Out.Bi.z = 0; 132 | Out.Tan.x = (rt.p * ct) * (rp.d*cp-rp.p*sp); 133 | Out.Tan.y = (rt.p * st) * (rp.d*cp-rp.p*sp); 134 | Out.Tan.z = (rp.d*sp+rp.p*cp); 135 | return Out; 136 | } 137 | 138 | float m; 139 | float n1; 140 | float n2; 141 | float n3; 142 | 143 | float mb; 144 | float n1b; 145 | float n2b; 146 | float n3b; 147 | 148 | 149 | vs2ps VS( 150 | float4 PosO : POSITION, 151 | float4 TexCd : TEXCOORD0) 152 | { 153 | //inititalize all fields of output struct with 0 154 | vs2ps Out = (vs2ps)0; 155 | //transform position 156 | PosO = mul(PosO, TT); 157 | PosBiTan supa = sfs3D(m, n1, n2, n3,mb, n1b, n2b, n3b, PosO.x, PosO.y); 158 | PosO.xyz = supa.Pos; 159 | Out.LightDirV = normalize(-mul(lDir, tV)); 160 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 161 | Out.Pos = mul(PosO, tWVP); 162 | Out.Bi = mul(float4(supa.Bi, 0), tWV); 163 | Out.Tan = mul(float4(supa.Tan, 0), tWV); 164 | Out.TexCol = PosO; 165 | //transform texturecoordinates 166 | Out.TexCd = mul(TexCd, tTex); 167 | return Out; 168 | } 169 | 170 | // 171 | //---------------------------------------------------------------------------- 172 | //---------------------- 173 | // PIXELSHADERS: 174 | // 175 | //---------------------------------------------------------------------------- 176 | //---------------------- 177 | float4 PS(vs2ps In): COLOR 178 | { 179 | 180 | 181 | float3 n = normalize(cross(In.Tan, In.Bi)); 182 | 183 | lAmb.a = 1; 184 | //halfvector 185 | float3 H = normalize(In.ViewDirV + In.LightDirV); 186 | 187 | //compute blinn lighting 188 | float3 shades = lit(dot(n, In.LightDirV), dot(n, H), lPower); 189 | 190 | float4 diff = lDiff * shades.y; 191 | diff.a = 1; 192 | 193 | //reflection vector (view space) 194 | float3 R = normalize(2 * dot(n, In.LightDirV) * n - In.LightDirV); 195 | //normalized view direction (view space) 196 | float3 V = normalize(In.ViewDirV); 197 | 198 | //calculate specular light 199 | float4 spec = pow(max(dot(R, V),0), lPower*.2) * lSpec; 200 | 201 | float4 col = tex2D(Samp, In.TexCd); 202 | col.rgb *= (lAmb + diff) + spec; 203 | return col; 204 | } 205 | 206 | 207 | // 208 | //---------------------------------------------------------------------------- 209 | //---------------------- 210 | // TECHNIQUES: 211 | // 212 | //---------------------------------------------------------------------------- 213 | //---------------------- 214 | technique TSupaFormula_sphere 215 | { 216 | pass P0 217 | { 218 | //Wrap0 = U; // useful when mesh is round like a sphere 219 | VertexShader = compile vs_2_0 VS(); 220 | PixelShader = compile ps_2_0 PS(); //******* 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /04_PhysicsBio/02_ReactiveDiffusion/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/reaction-diffusion 2 | 3 | by sanch -------------------------------------------------------------------------------- /04_PhysicsBio/02_ReactiveDiffusion/effects/ReactiveDiffusion.fx: -------------------------------------------------------------------------------- 1 | 2 | // ------------------------------------------------------------------------------------------------------------------------------------- 3 | // PARAMETERS: 4 | // ------------------------------------------------------------------------------------------------------------------------------------- 5 | 6 | //transforms 7 | float4x4 tW: WORLD; //the models world matrix 8 | float4x4 tV: VIEW; //view matrix as set via Renderer (DX9) 9 | float4x4 tP: PROJECTION; //projection matrix as set via Renderer (DX9) 10 | float4x4 tWVP: WORLDVIEWPROJECTION; 11 | 12 | //texture 13 | texture textrd ; // a texture holding the output of the last frame 14 | texture textparam ; 15 | 16 | float4 paramin; 17 | float4 paramax; 18 | 19 | sampler samp = sampler_state 20 | { 21 | Texture = (textrd); 22 | MipFilter = NONE; 23 | MinFilter = point; 24 | MagFilter = point; 25 | 26 | }; 27 | sampler samp2 = sampler_state 28 | { 29 | Texture = (textparam); 30 | MipFilter = NONE; 31 | MinFilter = point; 32 | MagFilter = point; 33 | 34 | }; 35 | 36 | 37 | 38 | 39 | 40 | float rx = 1/1024; 41 | float ry = 1/1024; 42 | 43 | // ------------------------------------------------------------------------------------------------------------------------------------- 44 | // VERTEXSHADERS 45 | // ------------------------------------------------------------------------------------------------------------------------------------- 46 | 47 | struct VS_OUTPUT 48 | { 49 | float4 Pos : POSITION; 50 | float2 TexC : TEXCOORD0; 51 | }; 52 | 53 | VS_OUTPUT VS( 54 | float4 Pos : POSITION, 55 | float2 TexC : TEXCOORD) 56 | { 57 | //inititalize all fields of output struct with 0 58 | VS_OUTPUT Out = (VS_OUTPUT)0; 59 | 60 | //transform position 61 | Pos = mul(Pos, tWVP); 62 | 63 | Out.Pos = Pos; 64 | Out.TexC = TexC; 65 | 66 | return Out; 67 | } 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | // ------------------------------------------------------------------------------------------------------------------------------------- 77 | // PIXELSHADERS: 78 | // ------------------------------------------------------------------------------------------------------------------------------------- 79 | 80 | float4 PS(float2 TexC: TEXCOORD0): COLOR 81 | { 82 | 83 | float4 d_1 = tex2D(samp, TexC); 84 | float4 parm = tex2D(samp2, TexC); 85 | 86 | parm.rgba = lerp(paramin.rgba,paramax.rgba,parm.rgba); 87 | 88 | 89 | 90 | 91 | 92 | 93 | float2 d_1n = tex2D(samp, float2(TexC.x-rx, TexC.y)); 94 | d_1n += tex2D(samp, float2(TexC.x+rx, TexC.y)); 95 | d_1n += tex2D(samp, float2(TexC.x, TexC.y-ry)); 96 | d_1n += tex2D(samp, float2(TexC.x, TexC.y+ry)); 97 | 98 | float2 diffusion = (d_1n / 4) * parm.xy ; 99 | 100 | float2 reaction = d_1.xx * d_1.yy* d_1n.yy ; 101 | reaction.x *=-1; 102 | reaction.x += (1- parm.x) * d_1.x + parm.z * (1 - d_1.x ) ; 103 | reaction.y += (-parm.z - parm.w +(1-parm.y))* d_1.y; 104 | 105 | float4 result = 1; 106 | 107 | result.rg = diffusion + (reaction); 108 | result.b= 0.2; 109 | 110 | return result; 111 | 112 | } 113 | 114 | // ------------------------------------------------------------------------------------------------------------------------------------- 115 | // TECHNIQUES: 116 | // ------------------------------------------------------------------------------------------------------------------------------------- 117 | 118 | technique reaction_diffusion 119 | { 120 | pass P0 121 | { 122 | VertexShader = compile vs_1_1 VS(); 123 | PixelShader = compile ps_2_0 PS(); 124 | } 125 | } 126 | //shader by : sanch 127 | //http://www.sanchtv.com 128 | -------------------------------------------------------------------------------- /04_PhysicsBio/03_DLA/_advanced/DLA_3D/_credits.txt: -------------------------------------------------------------------------------- 1 | by gregsn & tonfilm -------------------------------------------------------------------------------- /04_PhysicsBio/03_DLA/subpatches/DistanceSort.v4p: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /04_PhysicsBio/04_Attractor/_advanced/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/chaostoys 2 | 3 | by fibo -------------------------------------------------------------------------------- /04_PhysicsBio/06_Agents/_advanced/M_1_6_01_TOOL_Agents in the Space/M_1_6_01_TOOL-DirectX Renderer_2012.10.08-20.45.44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/04_PhysicsBio/06_Agents/_advanced/M_1_6_01_TOOL_Agents in the Space/M_1_6_01_TOOL-DirectX Renderer_2012.10.08-20.45.44.png -------------------------------------------------------------------------------- /04_PhysicsBio/06_Agents/_advanced/M_1_6_01_TOOL_Agents in the Space/_credits.txt: -------------------------------------------------------------------------------- 1 | http://www.generative-gestaltung.de/M_1_6_01_TOOL 2 | 3 | by robotanton -------------------------------------------------------------------------------- /04_PhysicsBio/07_Swarming/1AnimationFlockingBehavior.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/04_PhysicsBio/07_Swarming/1AnimationFlockingBehavior.dll -------------------------------------------------------------------------------- /04_PhysicsBio/07_Swarming/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/boids-3d 2 | 3 | by raul -------------------------------------------------------------------------------- /05_Tessellation/01_ConnectAll/ConnectAll/ConnectAll.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.Composition; 5 | 6 | using VVVV.PluginInterfaces.V1; 7 | using VVVV.PluginInterfaces.V2; 8 | using VVVV.Utils.VColor; 9 | using VVVV.Utils.VMath; 10 | 11 | using VVVV.Core.Logging; 12 | #endregion usings 13 | 14 | namespace VVVV.Nodes 15 | { 16 | #region PluginInfo 17 | [PluginInfo(Name = "ConnectAll", 18 | Category = "3d", 19 | Help = "Returns pairs of vertices that have a distance less than the given radius.")] 20 | #endregion PluginInfo 21 | public class ConnectAll : IPluginEvaluate 22 | { 23 | #region fields & pins 24 | [Input("Input")] 25 | ISpread FInput; 26 | 27 | [Input("Max Radius", DefaultValue = 1)] 28 | ISpread FMaxRadius; 29 | 30 | [Output("Output")] 31 | ISpread FOutput; 32 | 33 | [Output("Distance")] 34 | ISpread FDistance; 35 | 36 | //the internal list used to store vectors with a distance 37 | //less than the given radius 38 | List FDots = new List(); 39 | //another list that stores the actual distance between two points 40 | List FDistances = new List(); 41 | #endregion fields & pins 42 | 43 | //called when data for any output pin is requested 44 | public void Evaluate(int SpreadMax) 45 | { 46 | //for each frame empty the lists 47 | FDots.Clear(); 48 | FDistances.Clear(); 49 | 50 | //for every incoming vector... 51 | for (int i = 0; i < SpreadMax; i++) 52 | { 53 | //check every other incoming vector... 54 | for (int j = i + 1; j < SpreadMax; j++) 55 | { 56 | //if the distance is less than the given radius... 57 | var d = VMath.Dist(FInput[i], FInput[j]); 58 | if (d <= FMaxRadius[0]) 59 | { 60 | //add both vecotors to the list 61 | FDots.Add(FInput[i]); 62 | FDots.Add(FInput[j]); 63 | 64 | //add the distace between the two vectors to the list 65 | FDistances.Add(d / FMaxRadius[0]); 66 | } 67 | } 68 | } 69 | 70 | //in beta>24.1 you can directly assign lists to pins 71 | //FOutput.AssignFrom(FDots); 72 | //FDistance.AssignFrom(distances); 73 | 74 | //in beta24.1 you still have to move the list entries 75 | //to the output slices manually 76 | FOutput.SliceCount = FDots.Count; 77 | FDistance.SliceCount = FDistances.Count; 78 | 79 | for (int i = 0; i 2 | 3 | {8CE13434-6C67-481C-BF0F-16597EE97D09} 4 | Debug 5 | x86 6 | Library 7 | ConnectAll 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | 18 | 19 | 20 | VVVV.PluginInterfaces.dll 21 | 22 | 23 | 24 | System.ComponentModel.Composition.dll 25 | 26 | 27 | 28 | VVVV.Core.dll 29 | 30 | 31 | VVVV.Utils.dll 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /05_Tessellation/01_ConnectAll/ConnectAll/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /05_Tessellation/01_ConnectAll/ConnectAll/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/connectall 2 | 3 | by joreg -------------------------------------------------------------------------------- /06_CG/01_GeometryDeformation/_advanced/_credits.txt: -------------------------------------------------------------------------------- 1 | by Natan Sinigaglia & Pedro Mari -------------------------------------------------------------------------------- /06_CG/01_GeometryDeformation/_advanced/fluiDynamicSphere_ref.v4p: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /06_CG/02_VertexDisplacement/_advanced/Heightmap Displacement/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/heightmap-displacement 2 | 3 | by desaxismundis & sanch -------------------------------------------------------------------------------- /06_CG/02_VertexDisplacement/_advanced/Heightmap Displacement/grcanyon.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/06_CG/02_VertexDisplacement/_advanced/Heightmap Displacement/grcanyon.PNG -------------------------------------------------------------------------------- /06_CG/02_VertexDisplacement/effects/Displacement.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: 3 | //@tags: demo, basic 4 | // PARAMETERS ------------------------------------------------------------------ 5 | //transforms 6 | float4x4 tWVP: WORLDVIEWPROJECTION; 7 | 8 | float amount = 0.3333; 9 | 10 | //material properties 11 | float4 cAmb : COLOR = {1, 1, 1, 1}; 12 | float Alpha = 1; 13 | 14 | //texture 15 | texture Tex ; 16 | sampler Samp = sampler_state //sampler for doing the texture-lookup 17 | { 18 | Texture = (Tex); //apply a texture to the sampler 19 | Filter = MIN_MAG_MIP_LINEAR; 20 | }; 21 | // VERTEXSHADERS --------------------------------------------------------------- 22 | void VS(inout float4 Pos : POSITION, inout float4 TexCd : TEXCOORD0) 23 | { 24 | Pos.z -= tex2Dlod(Samp,TexCd).b*amount; 25 | Pos = mul(Pos, tWVP); 26 | } 27 | // PIXELSHADERS ---------------------------------------------------------------- 28 | float4 PS(float4 TexCd : TEXCOORD0): COLOR 29 | { 30 | float4 col = tex2D(Samp,TexCd) * cAmb; 31 | col.a *= Alpha; 32 | return col; 33 | } 34 | // TECHNIQUES ------------------------------------------------------------------ 35 | technique TDisplaceSimple 36 | { 37 | pass P0 38 | { 39 | VertexShader = compile vs_3_0 VS(); 40 | PixelShader = compile ps_3_0 PS(); 41 | } 42 | } -------------------------------------------------------------------------------- /06_CG/03_PixelDisplacement/SelfDisplacement.fx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------- 2 | // PARAMETERS: 3 | // -------------------------------------------------------------------------------------------------- 4 | 5 | float4x4 tWVP: WORLDVIEWPROJECTION; 6 | 7 | texture ImageTexture; 8 | sampler2D Samp = sampler_state 9 | { 10 | Texture = ; 11 | MipFilter = LINEAR; //sampler states 12 | MinFilter = LINEAR; 13 | MagFilter = LINEAR; 14 | }; 15 | 16 | float Displacement < 17 | string UIWidget = "slider"; 18 | float UIMin = 0.0; 19 | float UIMax = 1.0; 20 | float UIStep = 0.001; 21 | > = 0.01f; 22 | 23 | float4x4 tColor ; 24 | 25 | struct vs2ps 26 | { 27 | float4 Pos : POSITION; 28 | float4 TexCd : TEXCOORD0; 29 | }; 30 | 31 | // -------------------------------------------------------------------------------------------------- 32 | // VERTEXSHADERS 33 | // -------------------------------------------------------------------------------------------------- 34 | 35 | vs2ps VS( 36 | float4 Pos : POSITION, 37 | float4 TexCd : TEXCOORD) 38 | { 39 | //inititalize all fields of output struct with 0 40 | vs2ps Out = (vs2ps)0; 41 | 42 | //transform position 43 | Pos = mul(Pos, tWVP); 44 | //transform texturecoordinates 45 | Out.TexCd =TexCd; 46 | Out.Pos = Pos; 47 | return Out; 48 | } 49 | 50 | // -------------------------------------------------------------------------------------------------- 51 | // PIXELSHADERS: 52 | // -------------------------------------------------------------------------------------------------- 53 | 54 | float4 dispPS(vs2ps In) : COLOR 55 | { 56 | float2 disp = Displacement*(((float4)tex2D(Samp, In.TexCd))); 57 | float4 texCol = tex2D(Samp,In.TexCd + disp); 58 | return mul(texCol,tColor); 59 | } 60 | 61 | // -------------------------------------------------------------------------------------------------- 62 | // TECHNIQUES: 63 | // -------------------------------------------------------------------------------------------------- 64 | 65 | technique deformTexture { 66 | pass TexturePass { 67 | VertexShader = compile vs_2_0 VS(); 68 | 69 | PixelShader = compile ps_2_a dispPS(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /06_CG/03_PixelDisplacement/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/documentation/desaxismundipatches 2 | 3 | by desaxismundis -------------------------------------------------------------------------------- /06_CG/03_PixelDisplacement/dot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/06_CG/03_PixelDisplacement/dot.jpg -------------------------------------------------------------------------------- /contributions/ChaosToys/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/chaostoys 2 | 3 | by fibo -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/2dPeano/2dPeano.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} 4 | Debug 5 | x86 6 | Library 7 | VVVV.Nodes 8 | 2dPeano 9 | v3.5 10 | bin\Debug\ 11 | True 12 | Full 13 | False 14 | True 15 | DEBUG;TRACE 16 | $(VVVV45)\bin\managed\ 17 | $(VVVV45)\vvvv.exe 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/2dPeano/C2dPeanoNode.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.Composition; 5 | 6 | using VVVV.PluginInterfaces.V1; 7 | using VVVV.PluginInterfaces.V2; 8 | using VVVV.Utils.VColor; 9 | using VVVV.Utils.VMath; 10 | 11 | using VVVV.Core.Logging; 12 | #endregion usings 13 | 14 | namespace VVVV.Nodes 15 | { 16 | #region PluginInfo 17 | [PluginInfo(Name = "Peano", Category = "2d", Help = "Basic template with one value in/out", Tags = "")] 18 | #endregion PluginInfo 19 | public class C2dPeanoNode : IPluginEvaluate 20 | { 21 | #region fields & pins 22 | private int recurse = 0; 23 | 24 | [Input("A ")] 25 | IDiffSpread FInputA; 26 | 27 | [Input("B ")] 28 | IDiffSpread FInputB; 29 | 30 | [Input("C ")] 31 | IDiffSpread FInputC; 32 | 33 | [Input("D ")] 34 | IDiffSpread FInputD; 35 | 36 | [Input("Interactions", DefaultValue = 1, MinValue = 1, StepSize = 1, IsSingle = true, AsInt = true)] 37 | IDiffSpread FInteractions; 38 | 39 | [Output("Output ")] 40 | ISpread FOutput; 41 | 42 | [Import()] 43 | ILogger FLogger; 44 | #endregion fields & pins 45 | 46 | 47 | /// 48 | /// One iteration 49 | /// 50 | /// 51 | protected List Iteration(List points) 52 | { 53 | try 54 | { 55 | List outpoints = new List(); 56 | 57 | 58 | for(int i = 0; i < points.Count; i = i + 4){ 59 | Vector2D center = new Vector2D(( points[i].x + points[i+1].x + points[i+2].x + points[i+3].x )/4,( points[i].y + points[i+1].y + points[i+2].y + points[i+3].y )/4); 60 | 61 | Vector2D a = new Vector2D(); 62 | Vector2D b = new Vector2D(); 63 | Vector2D c = new Vector2D(); 64 | Vector2D d = new Vector2D(); 65 | 66 | // translate to origin 67 | a = points[i] - center; 68 | b = points[i+1] - center; 69 | c = points[i+2] - center; 70 | d = points[i+3] - center; 71 | 72 | // scale 73 | a = a/2; 74 | b = b/2; 75 | c = c/2; 76 | d = d/2; 77 | 78 | // translate to each of the four starting points 79 | // every input point generates 4 output points 80 | outpoints.Add(new Vector2D(a.x + points[i].x,a.y + points[i].y)); 81 | outpoints.Add(new Vector2D(d.x + points[i].x,d.y + points[i].y)); 82 | outpoints.Add(new Vector2D(c.x + points[i].x,c.y + points[i].y)); 83 | outpoints.Add(new Vector2D(b.x + points[i].x,b.y + points[i].y)); 84 | 85 | outpoints.Add(new Vector2D(a.x + points[i+1].x,a.y + points[i+1].y)); 86 | outpoints.Add(new Vector2D(b.x + points[i+1].x,b.y + points[i+1].y)); 87 | outpoints.Add(new Vector2D(c.x + points[i+1].x,c.y + points[i+1].y)); 88 | outpoints.Add(new Vector2D(d.x + points[i+1].x,d.y + points[i+1].y)); 89 | 90 | outpoints.Add(new Vector2D(a.x + points[i+2].x,a.y + points[i+2].y)); 91 | outpoints.Add(new Vector2D(b.x + points[i+2].x,b.y + points[i+2].y)); 92 | outpoints.Add(new Vector2D(c.x + points[i+2].x,c.y + points[i+2].y)); 93 | outpoints.Add(new Vector2D(d.x + points[i+2].x,d.y + points[i+2].y)); 94 | 95 | outpoints.Add(new Vector2D(c.x + points[i+3].x,c.y + points[i+3].y)); 96 | outpoints.Add(new Vector2D(b.x + points[i+3].x,b.y + points[i+3].y)); 97 | outpoints.Add(new Vector2D(a.x + points[i+3].x,a.y + points[i+3].y)); 98 | outpoints.Add(new Vector2D(d.x + points[i+3].x,d.y + points[i+3].y)); 99 | } 100 | 101 | recurse--; 102 | if (recurse > 0) 103 | outpoints = Iteration(outpoints); 104 | 105 | return outpoints; 106 | } 107 | catch (Exception ex) 108 | { 109 | //Flogger.Log(LogType.Debug, "Iteration error: " + ex.Message); 110 | return null; 111 | } 112 | } 113 | 114 | //called when data for any output pin is requested 115 | public void Evaluate(int SpreadMax) 116 | { 117 | if (FInteractions.IsChanged || FInputA.IsChanged || FInputB.IsChanged || FInputC.IsChanged || FInputD.IsChanged ) 118 | { 119 | if (FInputA.SliceCount == 0) return; 120 | if (FInputB.SliceCount == 0) return; 121 | if (FInputC.SliceCount == 0) return; 122 | if (FInputD.SliceCount == 0) return; 123 | 124 | List inputpoints = new List(); 125 | /// copy inputs points to list 126 | inputpoints.Add(FInputA[0]); 127 | inputpoints.Add(FInputB[0]); 128 | inputpoints.Add(FInputC[0]); 129 | inputpoints.Add(FInputD[0]); 130 | recurse = FInteractions[0]; 131 | 132 | List outpoints = Iteration(inputpoints); 133 | if (outpoints == null) return; 134 | FOutput.SliceCount = outpoints.Count; 135 | for (int i = 0; i < outpoints.Count; i++) 136 | FOutput[i] = outpoints[i]; 137 | 138 | } 139 | //FLogger.Log(LogType.Debug, "hi tty!"); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/2dPeano/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/CircleInversion.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/CircleInversion.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/CliffordAttractor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/CliffordAttractor.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/DuffingOscillator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/DuffingOscillator.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/Ikeda.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/Ikeda.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/Koch/Koch.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.Composition; 5 | 6 | using VVVV.PluginInterfaces.V1; 7 | using VVVV.PluginInterfaces.V2; 8 | using VVVV.Utils.VColor; 9 | using VVVV.Utils.VMath; 10 | 11 | using VVVV.Core.Logging; 12 | #endregion usings 13 | 14 | 15 | namespace VVVV.Nodes 16 | { 17 | #region PluginInfo 18 | [PluginInfo(Name = "Koch", Category = "2d", Author = "fibo", Help = "", Tags = "2d,curve,fractal")] 19 | #endregion PluginInfo 20 | public class Koch : IPluginEvaluate 21 | { 22 | 23 | #region fields & pins 24 | private int recurse = 0; 25 | 26 | [Input("Input ", DefaultValue = 1.0)] 27 | IDiffSpread FInput; 28 | 29 | [Input("K1", DefaultValue = 0.333)] 30 | IDiffSpread FK1; 31 | 32 | [Input("K2", DefaultValue = 0.433)] 33 | IDiffSpread FK2; 34 | 35 | [Input("K3", DefaultValue = 0.666)] 36 | IDiffSpread FK3; 37 | 38 | [Input("Interactions", DefaultValue = 1, MinValue = 1, StepSize = 1, IsSingle = true, AsInt = true)] 39 | IDiffSpread FInteractions; 40 | 41 | [Output("Output ")] 42 | ISpread FOutput; 43 | 44 | [Import()] 45 | ILogger Flogger; 46 | #endregion fields & pins 47 | 48 | /// 49 | /// One iteration 50 | /// 51 | /// 52 | protected List Iteration(List points) 53 | { 54 | try 55 | { 56 | List outpoints = new List(); 57 | for (int i = 0; i < points.Count + (points.Count - 1) * 3; i++) 58 | outpoints.Add(new Vector2D()); 59 | 60 | 61 | for (int i = 0; i < points.Count - 1; i++) 62 | { 63 | Vector2D perpendicular = new Vector2D(points[i + 1].y - points[i].y, points[i].x - points[i + 1].x); 64 | 65 | outpoints[4 * i] = points[i]; 66 | outpoints[4 * i + 1] = points[i] + (points[i + 1] - points[i]) * FK1[i]; 67 | outpoints[4 * i + 2] = points[i] * 0.5 + points[i + 1] * 0.5 + perpendicular * FK2[i]; 68 | outpoints[4 * i + 3] = points[i] + (points[i + 1] - points[i]) * FK3[i]; 69 | } 70 | outpoints[outpoints.Count - 1] = points[points.Count - 1]; 71 | recurse--; 72 | if (recurse > 0) 73 | outpoints = Iteration(outpoints); 74 | return outpoints; 75 | } 76 | catch (Exception ex) 77 | { 78 | Flogger.Log(LogType.Debug, "Iteration error: " + ex.Message); 79 | return null; 80 | } 81 | } 82 | 83 | //called when data for any output pin is requested 84 | public void Evaluate(int SpreadMax) 85 | { 86 | 87 | if (FInput.IsChanged || FK1.IsChanged || FK2.IsChanged || FK3.IsChanged || FInteractions.IsChanged) 88 | { 89 | if (FInput.SliceCount == 0) return; 90 | List inputpoints = new List(); 91 | /// copy input points to list 92 | for (int i = 0; i < FInput.SliceCount; i++) 93 | inputpoints.Add(FInput[i]); 94 | recurse = FInteractions[0]; 95 | List outpoints = Iteration(inputpoints); 96 | if (outpoints == null) return; 97 | FOutput.SliceCount = outpoints.Count; 98 | for (int i = 0; i < outpoints.Count; i++) 99 | FOutput[i] = outpoints[i]; 100 | } 101 | 102 | //Flogger.Log(LogType.Debug, "Logging to Renderer (TTY)"); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/Koch/Koch.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {4F4F384A-87B7-48B5-A7CE-6F6B026CA2AD} 4 | Debug 5 | x86 6 | Library 7 | VVVV.Nodes 8 | Koch 9 | v3.5 10 | bin\Debug\ 11 | True 12 | Full 13 | False 14 | True 15 | DEBUG;TRACE 16 | $(VVVV45)\bin\managed\ 17 | $(VVVV45)\vvvv.exe 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/Koch/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/LorenzAttractor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/LorenzAttractor.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/RösslerAttractor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/RösslerAttractor.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/TamariAttractor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/TamariAttractor.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/TemplateChaosToy2d0.1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("DemoPlugin")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("DemoPlugin")] 17 | [assembly: AssemblyCopyright("Copyright 2010")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("1.0.*")] 32 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/TemplateChaosToy2d0.1/TemplateChaosToy2d0.1.cs: -------------------------------------------------------------------------------- 1 | #region usings 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.Composition; 5 | 6 | using VVVV.PluginInterfaces.V1; 7 | using VVVV.PluginInterfaces.V2; 8 | using VVVV.Utils.VColor; 9 | using VVVV.Utils.VMath; 10 | 11 | using VVVV.Core.Logging; 12 | #endregion usings 13 | 14 | namespace VVVV.Nodes 15 | { 16 | #region PluginInfo 17 | [PluginInfo(Name = "TemplateChaosToy", Category = "2d", Version = "0.1", Author = "fibo", Help = "Basic template for a 2d Chaos Toy", Tags = "2d,chaos")] 18 | #endregion PluginInfo 19 | public class TemplateChaosToy : IPluginEvaluate 20 | { 21 | #region fields & pins 22 | [Input("Input", DefaultValue = 1.0)] 23 | IDiffSpread FInput; 24 | 25 | [Input("StepCount", DefaultValue = 0, MinValue = 0, StepSize = 1, IsSingle = true, AsInt = true)] 26 | IDiffSpread FStepCount; 27 | 28 | [Input("Reset", DefaultValue = 0, MinValue = 0, MaxValue = 1, StepSize = 1, IsSingle = true, IsBang = true, AsInt = true)] 29 | ISpread FReset; 30 | 31 | [Input("DeltaT", DefaultValue = 0.01, MinValue = -1, StepSize = 0.001, IsSingle = true)] 32 | ISpread FDeltaT; 33 | 34 | [Output("Output")] 35 | ISpread FOutput; 36 | 37 | [Import()] 38 | ILogger Flogger; 39 | 40 | double stepCount = 0; 41 | List previous = new List(); 42 | bool evolve = false; 43 | 44 | #endregion fields & pins 45 | 46 | //called when data for any output pin is requested 47 | public void Evaluate(int SpreadMax) 48 | { 49 | FOutput.SliceCount = FInput.SliceCount; 50 | 51 | if (FReset[0] == 1 || FStepCount.IsChanged || FInput.IsChanged) { 52 | stepCount = FStepCount[0]; 53 | previous.Clear(); 54 | for (int i = 0; i < FInput.SliceCount; i++) { 55 | previous.Add(new Vector2D()); 56 | previous[i] = FInput[i]; 57 | } 58 | evolve = true; 59 | } 60 | 61 | if (stepCount == 0) 62 | evolve = true; 63 | 64 | if (FDeltaT[0] == 0) 65 | evolve = false; 66 | 67 | if (evolve) { 68 | //Flogger.Log(LogType.Debug, "stepCount = " + stepCount); 69 | 70 | Vector2D current = new Vector2D(); 71 | 72 | for (int i = 0; i < FInput.SliceCount; i++) { 73 | 74 | //@@@@@@ edit here your dynamical system formula @@@@@@@@@@@ 75 | current.x = -previous[i].y + Math.Cos(previous[i].x); 76 | current.y = previous[i].x; 77 | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 78 | 79 | current *= FDeltaT[0]; 80 | 81 | previous[i] += current; 82 | 83 | //Flogger.Log(LogType.Debug, "current = " + current.x + " , " + current.y); 84 | //Flogger.Log(LogType.Debug, "previous = " + previous[i].x + " , " + previous[i].y); 85 | 86 | FOutput[i] = previous[i]; 87 | 88 | } 89 | 90 | } 91 | 92 | if (stepCount > 1) 93 | stepCount--; 94 | 95 | if (stepCount == 1) 96 | evolve = false; 97 | 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/TemplateChaosToy2d0.1/TemplateChaosToy2d0.1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {4AC51853-91E4-4591-B6B7-A39BF052D1E1} 4 | Debug 5 | x86 6 | Library 7 | TemplateChaosToy2d0.1 8 | v3.5 9 | bin\Debug\ 10 | True 11 | Full 12 | False 13 | True 14 | DEBUG;TRACE 15 | $(VVVV45)\bin\managed\ 16 | $(VVVV45)\vvvv.exe 17 | 18 | 19 | 20 | $(VVVV45)\bin\managed\VVVV.PluginInterfaces.dll 21 | 22 | 23 | 24 | $(VVVV45)\bin\managed\System.ComponentModel.Composition.dll 25 | 26 | 27 | 28 | $(VVVV45)\bin\managed\VVVV.Core.dll 29 | 30 | 31 | $(VVVV45)\bin\managed\VVVV.Utils.dll 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/TinkerBell.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/TinkerBell.dll -------------------------------------------------------------------------------- /contributions/ChaosToys/plugins/halo dot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woeishi/GenerativeDesignWorkshop/039636abf333a680e95291f07cd745fe54fdc403/contributions/ChaosToys/plugins/halo dot.bmp -------------------------------------------------------------------------------- /contributions/SplinesGPU/_credits.txt: -------------------------------------------------------------------------------- 1 | http://vvvv.org/contribution/splinesgpu 2 | 3 | by woei -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/B-Spline Cubic PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a cubic b-spline ribbon along 3d coordinates, calculated on the GPU 3 | //@tags: curve, spline, b-spline, cubic 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | 37 | struct vs2ps 38 | { 39 | float4 PosWVP: POSITION; 40 | float4 TexCd : TEXCOORD0; 41 | float4 PosCd : TEXCOORD1; 42 | float3 LightDirV: TEXCOORD2; 43 | float3 ViewDirV: TEXCOORD3; 44 | float3 Tang : TEXCOORD4; 45 | float3 Bi : TEXCOORD5; 46 | float4 Depth : TEXCOORD6; 47 | }; 48 | //---- B-Spline ---------------------------------------------------------------- 49 | struct pota { float4 Pos; float4 Tang; }; 50 | pota BSplineCubic(float4 p1, float4 p2, float4 p3, float4 p4, float range) { 51 | pota Out = (pota)0; 52 | 53 | float mu = frac(range); 54 | float4 a0 = p4 - p3*3 + p2*3 - p1; 55 | float4 a1 = p3*3 - p2*6 + p1*3.; 56 | float4 a2 = p3*3 - p1*3; 57 | float4 a3 = p3 + p2*4 + p1; 58 | 59 | Out.Pos = (a3+mu*(a2+mu*(a1+mu*a0)))/6.; 60 | Out.Tang = (mu*(2*a0*mu+a1)+mu*(a0*mu+a1)+a2)/6.; 61 | return Out; 62 | } 63 | // VERTEXSHADER----------------------------------------------------------------- 64 | float pitch; 65 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO: NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 66 | { 67 | vs2ps Out = (vs2ps)0; 68 | Out.LightDirV = normalize(-mul(lDir, tV)); 69 | 70 | float cSize = (Size-1)*0.9999; 71 | float4 cCd = PosCd; 72 | cCd.x = floor(cCd.x*(cSize))/cSize; 73 | 74 | float4 p1 = tex2Dlod(pSamp, float4(cCd.x-(1./cSize),cCd.yzw)); 75 | float4 p2 = tex2Dlod(pSamp, cCd); 76 | float4 p3 = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 77 | float4 p4 = tex2Dlod(pSamp, float4(cCd.x+(2./cSize),cCd.yzw)); 78 | 79 | pota curve = BSplineCubic(p1,p2,p3,p4,PosCd.x*cSize); 80 | float4 spline = curve.Pos; 81 | 82 | float3 rVec = 0; 83 | sincos(pitch,rVec.y,rVec.z); 84 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 85 | 86 | float3 tang = normalize(curve.Tang); 87 | float3 bitang= normalize(cross(tang,rVec)); 88 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 89 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 90 | 91 | bitang = normalize(cross(tang,mul(NormO,tR))); 92 | 93 | Out.PosWVP = mul(PosO, tWVP); 94 | Out.TexCd = mul(TexCd, tTex); 95 | 96 | //normal in view space 97 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 98 | Out.Tang = tang; 99 | Out.Bi = bitang; 100 | Out.Depth = mul(PosO, tWVP); 101 | return Out; 102 | } 103 | // PIXELSHADER------------------------------------------------------------------ 104 | float4 PS(vs2ps In): COLOR 105 | { 106 | float4 col = tex2D(Samp, In.TexCd); 107 | float3 n = normalize(cross(In.Tang,In.Bi)); 108 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 109 | col.a*=alpha; 110 | return mul(col, tColor); 111 | } 112 | 113 | float4 PS_Depth(vs2ps In): COLOR 114 | { 115 | float4 col = In.Depth.z; 116 | col.a =1; 117 | return col; 118 | } 119 | // TECHNIQUES------------------------------------------------------------------- 120 | technique BSplineCubic_PhongDirectional 121 | { 122 | pass P0 123 | { 124 | VertexShader = compile vs_3_0 VS_Spline(); 125 | PixelShader = compile ps_3_0 PS(); 126 | } 127 | } 128 | technique BSplineSplineCubic_Depth 129 | { 130 | pass P0 131 | { 132 | VertexShader = compile vs_3_0 VS_Spline(); 133 | PixelShader = compile ps_3_0 PS_Depth(); 134 | } 135 | } -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/Bezier-Spline PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a bezierspline ribbon along 3d coordinates, calculated on the GPU 3 | //@tags: curve, spline, bezier, cubic bezier 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | texture cTex ; 37 | sampler cSamp = sampler_state //sampler for doing the texture-lookup 38 | { 39 | Texture = (cTex); //apply a texture to the sampler 40 | MipFilter = POINT; //sampler states 41 | MinFilter = POINT; 42 | MagFilter = POINT; 43 | AddressU = clamp; 44 | ADDRESSV = wrap; 45 | }; 46 | 47 | struct vs2ps 48 | { 49 | float4 PosWVP: POSITION; 50 | float4 TexCd : TEXCOORD0; 51 | float4 PosCd : TEXCOORD1; 52 | float3 LightDirV: TEXCOORD2; 53 | float3 ViewDirV: TEXCOORD3; 54 | float3 Tang : TEXCOORD4; 55 | float3 Bi : TEXCOORD5; 56 | float4 Depth : TEXCOORD6; 57 | }; 58 | //---- Bezier-Spline ----------------------------------------------------------- 59 | bool rel = true; 60 | struct pota { float4 Pos; float4 Tang; }; 61 | pota BezierSpline(float4 p1, float4 t1, float4 p2, float4 t2, float range) { 62 | pota Out = (pota)0; 63 | 64 | float mu = frac(range); 65 | 66 | float4 c1 = t1+(p1*rel); 67 | float4 c2 = lerp(t2,-t2,rel)+(p2*rel); 68 | 69 | float mum1 = 1 - mu; 70 | float mum13 = mum1 * mum1 * mum1; 71 | float mu3 = mu * mu * mu; 72 | 73 | Out.Pos = mum13*p1 + 3*mu*mum1*mum1*c1 + 3*mu*mu*mum1*c2 + mu3*p2; 74 | Out.Tang = 3*(c1-p1)*mum1*mum1+3*(c2-c1)*2*mu*mum1+3*(p2-c2)*mu*mu; 75 | return Out; 76 | } 77 | // VERTEXSHADER----------------------------------------------------------------- 78 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO: NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 79 | { 80 | vs2ps Out = (vs2ps)0; 81 | Out.LightDirV = normalize(-mul(lDir, tV)); 82 | 83 | float cSize = (Size-1)*0.9999; 84 | float4 cCd = PosCd; 85 | cCd.x = floor(cCd.x*(cSize))/cSize; 86 | 87 | float4 p1 = tex2Dlod(pSamp, cCd); 88 | float4 t1 = tex2Dlod(cSamp, cCd); 89 | float4 p2 = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 90 | float4 t2 = tex2Dlod(cSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 91 | 92 | pota curve = BezierSpline(p1,float4(t1.xyz,0),p2,float4(t2.xyz,0),PosCd.x*cSize); 93 | float4 spline = curve.Pos; 94 | 95 | float3 rVec = 0; 96 | sincos(t1.w,rVec.y,rVec.z); 97 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 98 | 99 | float3 tang = normalize(curve.Tang); 100 | float3 bitang= normalize(cross(tang,rVec)); 101 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 102 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 103 | 104 | bitang = normalize(cross(tang,mul(NormO,tR))); 105 | 106 | Out.PosWVP = mul(PosO, tWVP); 107 | Out.TexCd = mul(TexCd, tTex); 108 | 109 | //normal in view space 110 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 111 | Out.Tang = tang; 112 | Out.Bi = bitang; 113 | Out.Depth = mul(PosO, tWVP); 114 | return Out; 115 | } 116 | // PIXELSHADER------------------------------------------------------------------ 117 | float4 PS(vs2ps In): COLOR 118 | { 119 | float4 col = tex2D(Samp, In.TexCd); 120 | float3 n = normalize(cross(In.Tang,In.Bi)); 121 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 122 | col.a*=alpha; 123 | return mul(col, tColor); 124 | } 125 | 126 | float4 PS_Depth(vs2ps In): COLOR 127 | { 128 | float4 col = In.Depth.z; 129 | col.a =1; 130 | return col; 131 | } 132 | // TECHNIQUES------------------------------------------------------------------- 133 | technique BezierSpline_PhongDirectional 134 | { 135 | pass P0 136 | { 137 | VertexShader = compile vs_3_0 VS_Spline(); 138 | PixelShader = compile ps_3_0 PS(); 139 | } 140 | } 141 | technique BezierSpline_Depth 142 | { 143 | pass P0 144 | { 145 | VertexShader = compile vs_3_0 VS_Spline(); 146 | PixelShader = compile ps_3_0 PS_Depth(); 147 | } 148 | } -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/Bezier-Spline Piecewise PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a bezier ribbon along 3d coordinates, calculated on the GPU 3 | //@tags: curve, spline, bezier, piecewise 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | 37 | 38 | texture cTex ; 39 | sampler cSamp = sampler_state //sampler for doing the texture-lookup 40 | { 41 | Texture = (cTex); //apply a texture to the sampler 42 | MipFilter = POINT; //sampler states 43 | MinFilter = POINT; 44 | MagFilter = POINT; 45 | AddressU = clamp; 46 | ADDRESSV = wrap; 47 | }; 48 | 49 | struct vs2ps 50 | { 51 | float4 PosWVP: POSITION; 52 | float4 TexCd : TEXCOORD0; 53 | float4 PosCd : TEXCOORD1; 54 | float3 LightDirV: TEXCOORD2; 55 | float3 ViewDirV: TEXCOORD3; 56 | float3 Tang : TEXCOORD4; 57 | float3 Bi : TEXCOORD5; 58 | float4 Depth : TEXCOORD6; 59 | }; 60 | //---- Bezier-Spline ----------------------------------------------------------- 61 | bool rel ; 62 | bool next ; 63 | struct pota { float4 Pos; float4 Tang; }; 64 | pota BezierSplinePW(float4 p1, float4 t1, float4 p2, float4 t2, float range) { 65 | pota Out = (pota)0; 66 | 67 | float mu = frac(range); 68 | 69 | float4 c1 = t1+(p1*rel); 70 | float4 c2 = lerp(t2, lerp(p1+t2,p2-t2,next), rel); 71 | 72 | float mum1 = 1 - mu; 73 | float mum13 = mum1 * mum1 * mum1; 74 | float mu3 = mu * mu * mu; 75 | 76 | Out.Pos = mum13*p1 + 3*mu*mum1*mum1*c1 + 3*mu*mu*mum1*c2 + mu3*p2; 77 | //Out.Pos = lerp(p1,p2,mu); 78 | //Out.Tang = float4(1,0,1,1); 79 | Out.Tang = 3*(c1-p1)*mum1*mum1+3*(c2-c1)*2*mu*mum1+3*(p2-c2)*mu*mu; 80 | return Out; 81 | } 82 | // VERTEXSHADER----------------------------------------------------------------- 83 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO: NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 84 | { 85 | vs2ps Out = (vs2ps)0; 86 | Out.LightDirV = normalize(-mul(lDir, tV)); 87 | 88 | float cSize = (Size-1)*0.9999; 89 | float4 cCd = PosCd; 90 | cCd.x = floor(cCd.x*cSize)/(cSize); 91 | 92 | float4 p1 = tex2Dlod(pSamp, float4(cCd.x,cCd.yzw)); 93 | float4 p2 = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 94 | 95 | float4 t1 = tex2Dlod(cSamp, float4(cCd.x,cCd.yzw)); 96 | float4 t2 = tex2Dlod(cSamp, float4(cCd.x+(0.5/cSize),cCd.yzw)); 97 | 98 | pota curve = BezierSplinePW(p1,float4(t1.xyz,0),p2,float4(t2.xyz,0),PosCd.x*cSize); 99 | float4 spline = curve.Pos; 100 | 101 | float3 rVec = 0; 102 | sincos(t1.w,rVec.y,rVec.z); 103 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 104 | 105 | float3 tang = normalize(curve.Tang); 106 | float3 bitang= normalize(cross(tang,rVec)); 107 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 108 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 109 | 110 | bitang = normalize(cross(tang,mul(NormO,tR))); 111 | 112 | Out.PosWVP = mul(PosO, tWVP); 113 | Out.TexCd = mul(TexCd, tTex); 114 | 115 | //normal in view space 116 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 117 | Out.Tang = tang; 118 | Out.Bi = bitang; 119 | Out.Depth = mul(PosO, tWVP); 120 | return Out; 121 | } 122 | // PIXELSHADER------------------------------------------------------------------ 123 | float4 PS(vs2ps In): COLOR 124 | { 125 | float4 col = tex2D(Samp, In.TexCd); 126 | float3 n = normalize(cross(In.Tang,In.Bi)); 127 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 128 | col.a*=alpha; 129 | return mul(col, tColor); 130 | } 131 | 132 | float4 PS_Depth(vs2ps In): COLOR 133 | { 134 | float4 col = In.Depth.z; 135 | col.a =1; 136 | return col; 137 | } 138 | // TECHNIQUES------------------------------------------------------------------- 139 | technique BezierSplinePW_PhongDirectional 140 | { 141 | pass P0 142 | { 143 | VertexShader = compile vs_3_0 VS_Spline(); 144 | PixelShader = compile ps_3_0 PS(); 145 | } 146 | } 147 | technique BezierSplinePW_Depth 148 | { 149 | pass P0 150 | { 151 | VertexShader = compile vs_3_0 VS_Spline(); 152 | PixelShader = compile ps_3_0 PS_Depth(); 153 | } 154 | } -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/Cosine-Spline PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a cosine spline along 3d coordinates, calculated on the GPU 3 | //@tags: line, spline, cosine 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | 37 | struct vs2ps 38 | { 39 | float4 PosWVP: POSITION; 40 | float4 TexCd : TEXCOORD0; 41 | float4 PosCd : TEXCOORD1; 42 | float3 LightDirV: TEXCOORD2; 43 | float3 ViewDirV: TEXCOORD3; 44 | float3 Tang : TEXCOORD4; 45 | float3 Bi : TEXCOORD5; 46 | float4 Depth : TEXCOORD6; 47 | }; 48 | //---- Cosine-Spline ----------------------------------------------------------- 49 | struct pota { float4 Pos; float4 Tang; }; 50 | pota CosineSpline(float4 p1, float4 p2, float range) { 51 | pota Out = (pota)0; 52 | const float PI = 3.14159265359; 53 | 54 | float mu = frac(range); 55 | float4 l = lerp(p1,p2,mu); 56 | mu = (1-cos(mu*PI))/2; 57 | l.yz = (p1.yz*(1-mu)+p2.yz*mu); 58 | Out.Pos = l; 59 | 60 | float4 t = p1-p2; 61 | mu = PI*sin(PI*mu)*0.5; 62 | t.yz = p2.yz*mu - p1.yz*mu; 63 | Out.Tang = t; 64 | return Out; 65 | } 66 | // VERTEXSHADER----------------------------------------------------------------- 67 | float pitch; 68 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO: NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 69 | { 70 | vs2ps Out = (vs2ps)0; 71 | Out.LightDirV = normalize(-mul(lDir, tV)); 72 | 73 | float cSize = (Size-1)*0.9999; 74 | float4 cCd = PosCd; 75 | cCd.x = floor(cCd.x*(cSize))/cSize; 76 | 77 | float4 p1 = tex2Dlod(pSamp, cCd); 78 | float4 p2 = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 79 | 80 | pota curve = CosineSpline(p1,p2,PosCd.x*cSize); 81 | float4 spline = curve.Pos; 82 | 83 | float3 rVec = 0; 84 | sincos(pitch,rVec.y,rVec.z); 85 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 86 | 87 | float3 tang = normalize(curve.Tang); 88 | float3 bitang= normalize(cross(tang,rVec)); 89 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 90 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 91 | 92 | bitang = normalize(cross(tang,mul(NormO,tR))); 93 | 94 | Out.PosWVP = mul(PosO, tWVP); 95 | Out.TexCd = mul(TexCd, tTex); 96 | 97 | //normal in view space 98 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 99 | Out.Tang = tang; 100 | Out.Bi = bitang; 101 | Out.Depth = mul(PosO, tWVP); 102 | return Out; 103 | } 104 | // PIXELSHADER------------------------------------------------------------------ 105 | float4 PS(vs2ps In): COLOR 106 | { 107 | float4 col = tex2D(Samp, In.TexCd); 108 | float3 n = normalize(cross(In.Tang,In.Bi)); 109 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 110 | col.a*=alpha; 111 | return mul(col, tColor); 112 | } 113 | 114 | float4 PS_Depth(vs2ps In): COLOR 115 | { 116 | float4 col = In.Depth.z; 117 | col.a =1; 118 | return col; 119 | } 120 | // TECHNIQUES------------------------------------------------------------------- 121 | technique CosineSpline_PhongDirectional 122 | { 123 | pass P0 124 | { 125 | VertexShader = compile vs_3_0 VS_Spline(); 126 | PixelShader = compile ps_3_0 PS(); 127 | } 128 | } 129 | technique CosineSpline_Depth 130 | { 131 | pass P0 132 | { 133 | VertexShader = compile vs_3_0 VS_Spline(); 134 | PixelShader = compile ps_3_0 PS_Depth(); 135 | } 136 | } -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/Cubic-Spline PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a cubic spline ribbon along 3d coordinates, calculated on the GPU 3 | //@tags: curve, spline, cubic 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | 37 | struct vs2ps 38 | { 39 | float4 PosWVP: POSITION; 40 | float4 TexCd : TEXCOORD0; 41 | float4 PosCd : TEXCOORD1; 42 | float3 LightDirV: TEXCOORD2; 43 | float3 ViewDirV: TEXCOORD3; 44 | float3 Tang : TEXCOORD4; 45 | float3 Bi : TEXCOORD5; 46 | float4 Depth : TEXCOORD6; 47 | }; 48 | //---- Cubic-Spline ------------------------------------------------------------ 49 | struct pota { float4 Pos; float4 Tang; }; 50 | pota CubicSpline(float4 p1, float4 p2, float4 p3, float4 p4, float range) { 51 | pota Out = (pota)0; 52 | 53 | float mu = frac(range); 54 | float4 a0 = p4 - p3 + p2 - p1; 55 | float4 a1 = p1 - p2 - a0; 56 | float4 a2 = p3 - p1; 57 | 58 | Out.Pos = (a0*mu*mu*mu + a1*mu*mu + a2*mu + p2); 59 | Out.Tang = a0*3*mu*mu + (-p4 + p3 - 2*p2 + 2*p1)*2*mu + a2; 60 | return Out; 61 | } 62 | // VERTEXSHADER----------------------------------------------------------------- 63 | float pitch; 64 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO:NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 65 | { 66 | vs2ps Out = (vs2ps)0; 67 | Out.LightDirV = normalize(-mul(lDir, tV)); 68 | 69 | float cSize = (Size-1)*0.9999; 70 | float4 cCd = PosCd; 71 | cCd.x = floor(cCd.x*(cSize))/cSize; 72 | 73 | float4 p1 = tex2Dlod(pSamp, float4(cCd.x-(1./cSize),cCd.yzw)); 74 | float4 p2 = tex2Dlod(pSamp, cCd); 75 | float4 p3 = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 76 | float4 p4 = tex2Dlod(pSamp, float4(cCd.x+(2./cSize),cCd.yzw)); 77 | 78 | pota curve = CubicSpline(p1,p2,p3,p4,PosCd.x*cSize); 79 | float4 spline = curve.Pos; 80 | 81 | float3 rVec = 0; 82 | sincos(pitch,rVec.y,rVec.z); 83 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 84 | 85 | float3 tang = normalize(curve.Tang); 86 | float3 bitang= normalize(cross(tang,rVec)); 87 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 88 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 89 | 90 | bitang = normalize(cross(tang,mul(NormO,tR))); 91 | 92 | Out.PosWVP = mul(PosO, tWVP); 93 | Out.TexCd = mul(TexCd, tTex); 94 | 95 | //normal in view space 96 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 97 | Out.Tang = tang; 98 | Out.Bi = bitang; 99 | Out.Depth = mul(PosO, tWVP); 100 | return Out; 101 | } 102 | // PIXELSHADER------------------------------------------------------------------ 103 | float4 PS(vs2ps In): COLOR 104 | { 105 | float4 col = tex2D(Samp, In.TexCd); 106 | float3 n = normalize(cross(In.Tang,In.Bi)); 107 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 108 | col.a*=alpha; 109 | return mul(col, tColor); 110 | } 111 | 112 | float4 PS_Depth(vs2ps In): COLOR 113 | { 114 | float4 col = In.Depth.z; 115 | col.a =1; 116 | return col; 117 | } 118 | // TECHNIQUES------------------------------------------------------------------- 119 | technique CubicSpline_PhongDirectional 120 | { 121 | pass P0 122 | { 123 | VertexShader = compile vs_3_0 VS_Spline(); 124 | PixelShader = compile ps_3_0 PS(); 125 | } 126 | } 127 | technique CubicSpline_Depth 128 | { 129 | pass P0 130 | { 131 | VertexShader = compile vs_3_0 VS_Spline(); 132 | PixelShader = compile ps_3_0 PS_Depth(); 133 | } 134 | } -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/Linear-Spline PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a ribbon along 3d coordinates, calculated on the GPU 3 | //@tags: line, spline, linear 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | 37 | struct vs2ps 38 | { 39 | float4 PosWVP: POSITION; 40 | float4 TexCd : TEXCOORD0; 41 | float4 PosCd : TEXCOORD1; 42 | float3 LightDirV: TEXCOORD2; 43 | float3 ViewDirV: TEXCOORD3; 44 | float3 Tang : TEXCOORD4; 45 | float3 Bi : TEXCOORD5; 46 | float4 Depth : TEXCOORD6; 47 | }; 48 | //---- Linear-Spline ----------------------------------------------------------- 49 | struct pota { float4 Pos; float4 Tang; }; 50 | pota LinearSpline(float4 p1, float4 p2, float range) { 51 | pota Out = (pota)0; 52 | Out.Pos = lerp(p1,p2,frac(range)); 53 | Out.Tang = p1-p2; 54 | return Out; 55 | } 56 | // VERTEXSHADER----------------------------------------------------------------- 57 | float pitch; 58 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO: NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 59 | { 60 | vs2ps Out = (vs2ps)0; 61 | Out.LightDirV = normalize(-mul(lDir, tV)); 62 | 63 | float cSize = (Size-1)*0.9999; 64 | float4 cCd = PosCd; 65 | cCd.x = floor(cCd.x*(cSize))/cSize; 66 | 67 | float4 p1 = tex2Dlod(pSamp, cCd); 68 | float4 p2 = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 69 | 70 | pota curve = LinearSpline(p1,p2,PosCd.x*cSize); 71 | float4 spline = curve.Pos; 72 | 73 | float3 rVec = 0; 74 | sincos(pitch,rVec.y,rVec.z); 75 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 76 | 77 | float3 tang = normalize(curve.Tang); 78 | float3 bitang= normalize(cross(tang,rVec)); 79 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 80 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 81 | 82 | bitang = normalize(cross(tang,mul(NormO,tR))); 83 | 84 | Out.PosWVP = mul(PosO, tWVP); 85 | Out.TexCd = mul(TexCd, tTex); 86 | 87 | //normal in view space 88 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 89 | Out.Tang = tang; 90 | Out.Bi = bitang; 91 | Out.Depth = mul(PosO, tWVP); 92 | return Out; 93 | } 94 | // PIXELSHADER------------------------------------------------------------------ 95 | float4 PS(vs2ps In): COLOR 96 | { 97 | float4 col = tex2D(Samp, In.TexCd); 98 | float3 n = normalize(cross(In.Tang,In.Bi)); 99 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 100 | col.a*=alpha; 101 | return mul(col, tColor); 102 | } 103 | 104 | float4 PS_Depth(vs2ps In): COLOR 105 | { 106 | float4 col = In.Depth.z; 107 | col.a =1; 108 | return col; 109 | } 110 | // TECHNIQUES------------------------------------------------------------------- 111 | technique LinearSpline_PhongDirectional 112 | { 113 | pass P0 114 | { 115 | VertexShader = compile vs_3_0 VS_Spline(); 116 | PixelShader = compile ps_3_0 PS(); 117 | } 118 | } 119 | technique LinearSpline_Depth 120 | { 121 | pass P0 122 | { 123 | VertexShader = compile vs_3_0 VS_Spline(); 124 | PixelShader = compile ps_3_0 PS_Depth(); 125 | } 126 | } -------------------------------------------------------------------------------- /contributions/SplinesGPU/effects/TCB-Spline PhongDirectional GPU.fx: -------------------------------------------------------------------------------- 1 | //@author: woei 2 | //@help: creates a hermite spline ribbon along 3d coordinates, calculated on the GPU 3 | //@tags: curve, spline, hermite, nurbs 4 | // PARAMETERS------------------------------------------------------------------- 5 | //transforms 6 | float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) 7 | float4x4 tWV: WORLDVIEW; 8 | float4x4 tWVP: WORLDVIEWPROJECTION; 9 | #include 10 | 11 | //texture 12 | texture Tex ; 13 | sampler Samp = sampler_state //sampler for doing the texture-lookup 14 | { 15 | Texture = (Tex); //apply a texture to the sampler 16 | MipFilter = LINEAR; //sampler states 17 | MinFilter = LINEAR; 18 | MagFilter = LINEAR; 19 | }; 20 | 21 | float4x4 tTex: TEXTUREMATRIX ; 22 | float4x4 tColor ; 23 | float alpha = 1.; 24 | 25 | int Size; 26 | texture pTex ; 27 | sampler pSamp = sampler_state //sampler for doing the texture-lookup 28 | { 29 | Texture = (pTex); //apply a texture to the sampler 30 | MipFilter = POINT; //sampler states 31 | MinFilter = POINT; 32 | MagFilter = POINT; 33 | AddressU = clamp; 34 | ADDRESSV = wrap; 35 | }; 36 | texture cTex ; 37 | sampler cSamp = sampler_state //sampler for doing the texture-lookup 38 | { 39 | Texture = (cTex); //apply a texture to the sampler 40 | MipFilter = POINT; //sampler states 41 | MinFilter = POINT; 42 | MagFilter = POINT; 43 | AddressU = clamp; 44 | ADDRESSV = wrap; 45 | }; 46 | 47 | struct vs2ps 48 | { 49 | float4 PosWVP: POSITION; 50 | float4 TexCd : TEXCOORD0; 51 | float4 PosCd : TEXCOORD1; 52 | float3 LightDirV: TEXCOORD2; 53 | float3 ViewDirV: TEXCOORD3; 54 | float3 Tang : TEXCOORD4; 55 | float3 Bi : TEXCOORD5; 56 | float4 Depth : TEXCOORD6; 57 | }; 58 | //---- TCB-Spline -------------------------------------------------------------- 59 | struct pota { float4 Pos; float4 Tang; }; 60 | pota TCBSpline(float4 x, float4 y, float4 z, float4 w, float3 tcb, float range) { 61 | pota Out = (pota)0; 62 | float mu = frac(range); 63 | float mu2 = mu*mu; 64 | float mu3 = mu2* mu; 65 | 66 | float4 m0 = (y-x)*.5*(1-tcb.x)*(1-tcb.y)*(1+tcb.z); 67 | m0+= (z-y)*.5*(1-tcb.x)*(1+tcb.y)*(1-tcb.z); 68 | float4 m1 = (z-y)*.5*(1-tcb.x)*(1+tcb.y)*(1+tcb.z); 69 | m1+= (w-z)*.5*(1-tcb.x)*(1-tcb.y)*(1-tcb.z); 70 | 71 | float4 a0 = 2.*mu3 - 3.*mu2 + 1.; 72 | float4 a1 = mu3 - 2.*mu2 + mu; 73 | float4 a2 = mu3 - mu2; 74 | float4 a3 = -2.*mu3 + 3*mu2; 75 | Out.Pos = a0*y+a1*m0+a2*m1+a3*z; 76 | 77 | a0 = 6.*mu2-6.*mu; 78 | a1 = 3.*mu2-4.*mu+1.; 79 | a2 = 3*mu2-2*mu; 80 | a3 = 6.*mu-6.*mu2; 81 | Out.Tang = a0*y+a1*m0+a2*m1+a3*z; 82 | return Out; 83 | } 84 | // VERTEXSHADER----------------------------------------------------------------- 85 | vs2ps VS_Spline(float4 PosO: POSITION, float3 NormO: NORMAL, float4 TexCd : TEXCOORD0, float4 PosCd : TEXCOORD1) 86 | { 87 | vs2ps Out = (vs2ps)0; 88 | Out.LightDirV = normalize(-mul(lDir, tV)); 89 | 90 | float4 cCd = PosCd; 91 | float cSize = (Size-1)*0.9999; 92 | cCd.x = floor(cCd.x*(cSize))/cSize; 93 | 94 | float4 a = tex2Dlod(pSamp, float4(cCd.x+(-1./cSize),cCd.yzw)); 95 | float4 b = tex2Dlod(pSamp, cCd); 96 | float4 c = tex2Dlod(pSamp, float4(cCd.x+(1./cSize),cCd.yzw)); 97 | float4 d = tex2Dlod(pSamp, float4(cCd.x+(2./cSize),cCd.yzw)); 98 | float4 tcb = tex2Dlod(cSamp, cCd); 99 | 100 | pota curve = TCBSpline(a,b,c,d,tcb.xyz,PosCd.x*cSize); 101 | float4 spline = curve.Pos; 102 | 103 | float3 rVec = 0; 104 | sincos(tcb.w,rVec.y,rVec.z); 105 | float3x3 tR = float3x3(float3(1,0,0), float3(0,rVec.z,-rVec.y), rVec); 106 | 107 | float3 tang = normalize(curve.Tang); 108 | float3 bitang= normalize(cross(tang,rVec)); 109 | float3x3 tBN = float3x3((float3)0,bitang,cross(tang,bitang)); 110 | PosO.xyz=spline.xyz+(mul(PosO.xyz,tBN)*spline.w); 111 | 112 | bitang = normalize(cross(tang,mul(NormO,tR))); 113 | 114 | Out.PosWVP = mul(PosO, tWVP); 115 | Out.TexCd = mul(TexCd, tTex); 116 | 117 | //normal in view space 118 | Out.ViewDirV = -normalize(mul(PosO, tWV)); 119 | Out.Tang = tang; 120 | Out.Bi = bitang; 121 | Out.Depth = mul(PosO, tWVP); 122 | return Out; 123 | } 124 | // PIXELSHADER------------------------------------------------------------------ 125 | float4 PS(vs2ps In): COLOR 126 | { 127 | float4 col = tex2D(Samp, In.TexCd); 128 | float3 n = normalize(cross(In.Tang,In.Bi)); 129 | col.rgb *= PhongDirectional(n, In.ViewDirV, In.LightDirV);; 130 | col.a*=alpha; 131 | return mul(col, tColor); 132 | } 133 | 134 | float4 PS_Depth(vs2ps In): COLOR 135 | { 136 | float4 col = In.Depth.z; 137 | col.a =1; 138 | return col; 139 | } 140 | // TECHNIQUES------------------------------------------------------------------- 141 | technique TCBSpline_PhongDirectional 142 | { 143 | pass P0 144 | { 145 | VertexShader = compile vs_3_0 VS_Spline(); 146 | PixelShader = compile ps_3_0 PS(); 147 | } 148 | } 149 | technique TCBSpline_Depth 150 | { 151 | pass P0 152 | { 153 | VertexShader = compile vs_3_0 VS_Spline(); 154 | PixelShader = compile ps_3_0 PS_Depth(); 155 | } 156 | } -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Generative Design Algorithms 2 | ### workshop material 3 | 4 | workshop is heavily based off a class of my generative design lecture @ FH-Hagenberg 5 | 6 | **used material created by others is credited and linked with best effort** 7 | 8 | everything else is authored by me & [jhnnslmk](https://github.com/jhnnslmk) --------------------------------------------------------------------------------