Commit 84e1e574 authored by BrutPitt's avatar BrutPitt
Browse files

Release 1.1.1

parent a871a444
......@@ -34,139 +34,26 @@
//
////////////////////////////////////////////////////////////////////////////////
// #version dynamically inserted
layout(std140) uniform;
layout (location = 0) in vec4 a_ActualPoint;
//layout (location = 0) in vec4 a_PrevPoint;
LAYUOT_BINDING(0) uniform sampler2D paletteTex;
LAYUOT_BINDING(2) uniform _particlesData {
vec3 lightDir;
float lightDiffInt;
vec3 lightColor;
float lightSpecInt;
vec2 scrnRes;
float lightAmbInt ;
float lightShinExp;
float sstepColorMin;
float sstepColorMax;
float pointSize;
float pointDistAtten;
float alphaDistAtten;
float alphaSkip;
float alphaK;
float colIntensity;
float clippingDist;
float zNear;
float zFar;
float velIntensity;
float ySizeRatio;
float ptSizeRatio;
float pointspriteMinSize;
bool lightActive;
} u;
LAYUOT_BINDING(4) uniform _tMat {
mat4 pMatrix;
mat4 mvMatrix;
mat4 mvpMatrix;
} m;
out gl_PerVertex
{
vec4 gl_Position;
float gl_PointSize;
};
// #include "ParticlesVert.glsl"
out float pointDist;
out vec4 vertParticleColor;
//#define USE_HLS_INTERNAL
#ifdef USE_HLS_INTERNAL
#define dueterzi 2./3.
#define unsesto 1./6.
#define unterzo 1./3.
float hue2rgb(float p, float q, float t)
{
if(t < 0.) t += 1.;
if(t > 1.) t -= 1.;
if(t < unsesto) return p + (q - p) * 6. * t;
if(t < .5) return q;
if(t < dueterzi) return p + (q - p) * (dueterzi - t) * 6.;
return p;
}
vec3 HLStoRGB( vec3 HLS)
{
if(HLS.z==0.0) { return HLS.yyy; }
float v2;
if(HLS.z>1) HLS.z = 1;
if(HLS.y>1) {
HLS.y = 1.f;
v2 = (HLS.y+HLS.z) - HLS.y*HLS.z;
} else
v2 = (HLS.y < 0.5) ? HLS.y*(1.0+HLS.z) : (HLS.y+HLS.z) - HLS.y*HLS.z;
float v1 = 2.0*HLS.y - v2;
return vec3 ( hue2rgb(v1, v2, HLS.x+unterzo),
hue2rgb(v1, v2, HLS.x),
hue2rgb(v1, v2, HLS.x-unterzo)
);
}
vec4 HLStoRGB( vec4 HLS)
{
return vec4(HLStoRGB(HLS.rgb), HLS.a);
}
#endif
void main(void)
{
gl_Position = m.mvMatrix * vec4(a_ActualPoint.xyz,1.f);
float vel = a_ActualPoint.w*u.velIntensity;
#ifdef USE_HLS_INTERNAL
vec4 cOut = HLStoRGB(vec4(vel,.5f,.99f, 1.0));
#else
vec4 cOut = vec4(texture(paletteTex, vec2(vel,0.f)).rgb,1.0);
#endif
pointDist = length(gl_Position.xyz);
float ptAtten = exp(-0.01*sign(pointDist)*pow(abs(pointDist)+1.f, u.pointDistAtten*.1));
gl_PointSize = u.pointSize/u.scrnRes.y * ptAtten * u.ySizeRatio;
vertParticleColor = cOut;
#if defined(GL_ES) || defined(TEST_WGL)
vertParticleColor = velColor();
#else
vertParticleColor = colorResult();
#endif
// Load OBJ
/*
uint packCol = floatBitsToUint(a_ActualPoint.w);
vec4 col = unpackUnorm4x8(packCol);
particleColor = col;
*/
}
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018 Michele Morrone
// All rights reserved.
//
// mailto:me@michelemorrone.eu
// mailto:brutpitt@gmail.com
//
// https://github.com/BrutPitt
//
// https://michelemorrone.eu
// https://BrutPitt.com
//
// This software is distributed under the terms of the BSD 2-Clause license:
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
////////////////////////////////////////////////////////////////////////////////
// #version dynamically inserted
layout(std140) uniform;
layout (location = 0) in vec4 a_ActualPoint;
LAYUOT_BINDING(0) uniform sampler2D paletteTex;
LAYUOT_BINDING(2) uniform _particlesData {
vec3 lightDir;
float lightDiffInt;
vec3 lightColor;
float lightSpecInt;
vec2 scrnRes;
float lightAmbInt ;
float lightShinExp;
float sstepColorMin;
float sstepColorMax;
float pointSize;
float pointDistAtten;
float alphaDistAtten;
float alphaSkip;
float alphaK;
float colIntensity;
float clippingDist;
float zNear;
float zFar;
float velIntensity;
float ySizeRatio;
float ptSizeRatio;
float pointspriteMinSize;
bool lightActive;
} u;
LAYUOT_BINDING(4) uniform _tMat { //shared?
mat4 pMatrix;
mat4 mvMatrix;
mat4 mvpMatrix;
} m;
#ifndef GL_ES
out gl_PerVertex
{
vec4 gl_Position;
float gl_PointSize;
};
#endif
#ifdef GL_ES
#define SUBROUTINE(X)
#else
subroutine vec4 _colorResult();
subroutine uniform _colorResult colorResult;
#define SUBROUTINE(X) subroutine(X)
#endif
//#define USE_HLS_INTERNAL
// Load OBJ
LAYUOT_INDEX(1) SUBROUTINE(_colorResult) vec4 objColor()
{
uint packCol = floatBitsToUint(a_ActualPoint.w);
vec4 col = unpackUnorm4x8(packCol);
return col;
}
LAYUOT_INDEX(0) SUBROUTINE(_colorResult) vec4 velColor()
{
float vel = a_ActualPoint.w*u.velIntensity;
return vec4(texture(paletteTex, vec2(vel,0.f)).rgb,1.0);
}
......@@ -34,59 +34,7 @@
//
////////////////////////////////////////////////////////////////////////////////
// #version dynamically inserted
/*
#if __VERSION__ >= 420
#define LAYUOT_BINDING(X) layout (location = X)
// #define SHARED_BINDING(X) layout (shared, location = X)
#else
#define LAYUOT_BINDING(X)
#endif*/
layout(std140) uniform;
uniform float velIntensity;
LAYUOT_BINDING(2) uniform _particlesData {
vec3 lightDir;
float lightDiffInt;
vec3 lightColor;
float lightSpecInt;
vec2 scrnRes;
float lightAmbInt ;
float lightShinExp;
float sstepColorMin;
float sstepColorMax;
float pointSize;
float pointDistAtten;
float alphaDistAtten;
float alphaSkip;
float alphaK;
float colIntensity;
float clippingDist;
float zNear;
float zFar;
float velIntensity;
float ySizeRatio;
float ptSizeRatio;
float pointspriteMinSize;
bool lightActive;
} u;
LAYUOT_BINDING(4) uniform _tMat { //shared?
mat4 pMatrix;
mat4 mvMatrix;
mat4 mvpMatrix;
} m;
#ifndef GL_ES
out gl_PerVertex
{
vec4 gl_Position;
float gl_PointSize;
};
#endif
// #include "ParticlesVert.glsl"
out vec3 mvVtxPos;
......@@ -94,11 +42,6 @@ out vec3 mvVtxPos;
out float pointDistance;
out vec4 particleColor;
LAYUOT_BINDING(0) uniform sampler2D paletteTex;
layout (location = 0) in vec4 a_ActualPoint;
void main()
{
......@@ -106,12 +49,14 @@ void main()
gl_Position = m.pMatrix * vtxPos;
mvVtxPos = vtxPos.xyz;
float vel = a_ActualPoint.w*u.velIntensity;
particleColor = vec4(texture(paletteTex, vec2(vel,0.f)).rgb,1.0);
#if defined(GL_ES) || defined(TEST_WGL)
particleColor = velColor();
#else
particleColor = colorResult();
#endif
pointDistance = gl_Position.w; //length(vtxPos.w);
float ptAtten = exp(-0.01*sign(pointDistance)*pow(abs(pointDistance)+1.f, u.pointDistAtten*.1));
float size = u.pointSize * ptAtten * u.ySizeRatio;
......
# [**glChAoS.P / wglChAoS.P - ver 1.1.0**](https://michelemorrone.eu/glchaosp)
# [**glChAoS.P / wglChAoS.P - ver 1.1.1**](https://michelemorrone.eu/glchaosp)
[**glChAoS.P**](https://michelemorrone.eu/glchaosp) / [**glChAoSP**](https://michelemorrone.eu/glchaosp): Open**gl** **Ch**aotic **A**ttractors **o**f **S**light (**dot**) **P**articles
A real time 3D strange attractor scout... and hypercompex fractals (new!)
Please read the release notes **ver. 1.1.0**: [**Release Notes**](https://github.com/BrutPitt/glChAoS.P/releases/tag/v1.1.0)
Please read the release notes for changes and new features of **ver. 1.1.1**: [**Release Notes**](https://github.com/BrutPitt/glChAoS.P/releases/tag/v1.1.1)
### [New Hypercomplex fractals](https://michelemorrone.eu/glchaosp/Hypercomplex.html)
| hypercomplex fractals | hypercomplex fractals |
......@@ -13,6 +15,9 @@ Please read the release notes **ver. 1.1.0**: [**Release Notes**](https://github
### [New WebGL2 online version](https://michelemorrone.eu/glchaosp/webGL.html)
New [**wglChAoS.P**](https://michelemorrone.eu/glchaosp/webGL.html) / [**wglChAoSP**](https://michelemorrone.eu/glchaosp/webGL.html) WebGL 2 / WebAssembly lightened **LIVE / ONLINE** version of [**glChAoSP**](https://michelemorrone.eu/glchaosp)
### Now supports touch screen for mobile devices, smartphones and tablets
|[![](https://raw.githubusercontent.com/BrutPitt/glChAoS.P/master/imgsCapture/ssWGLtitle.jpg)](https://michelemorrone.eu/glchaosp/webGL.html)|
| :-----: |
|[![](https://raw.githubusercontent.com/BrutPitt/glChAoS.P/master/imgsCapture/ssWGL_half.jpg)](https://michelemorrone.eu/glchaosp/webGL.html)|
......@@ -284,6 +289,9 @@ Structure and description of 3rd parts libraries/tools/palettes, and related cop
- libs/configuru → Configuru, an experimental JSON config library for C++
[https://github.com/emilk/Configuru](https://github.com/emilk/Configuru)
- libs/tinyPLY → C++11 ply 3d mesh format importer & exporter
[https://github.com/ddiakopoulos/tinyply](https://github.com/ddiakopoulos/tinyply)
- libs/lodePNG → LodePNG a PNG saver
[https://github.com/lvandeve/lodepng](https://github.com/lvandeve/lodepng)
......@@ -308,6 +316,7 @@ window and input
colorMaps/jjg\_step.json → J.J. Green palettes (creative commons noncommercial license)
[http://soliton.vm.bytemark.co.uk/pub/cpt-city/jjg/ccolo/index.html](http://soliton.vm.bytemark.co.uk/pub/cpt-city/jjg/ccolo/index.html)
Conversion from gpf format to json 256 variations.
(these are optional separate files to load for have more color maps)
## License
......
......@@ -340,7 +340,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>GLFW_INCLUDE_NONE;GLM_ENABLE_EXPERIMENTAL;IMGUI_IMPL_OPENGL_LOADER_GLAD;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;GLAPP_REQUIRE_OGL45;USE_THREAD_TO_FILL;USE_MAPPED_BUFFER;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>GLFW_INCLUDE_NONE;GLM_ENABLE_EXPERIMENTAL;IMGUI_IMPL_OPENGL_LOADER_GLAD;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;GLAPP_REQUIRE_OGL45;USE_THREAD_TO_FILL;USE_MAPPED_BUFFER;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\src\tools\;$(ProjectDir)..\..\src\libs\;$(ProjectDir)..\..\src\libs\glfw\include\</AdditionalIncludeDirectories>
......@@ -500,7 +500,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>GLFW_INCLUDE_NONE;GLM_ENABLE_EXPERIMENTAL;IMGUI_IMPL_OPENGL_LOADER_GLAD;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;GLAPP_REQUIRE_OGL45;USE_THREAD_TO_FILL;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>GLFW_INCLUDE_NONE;GLM_ENABLE_EXPERIMENTAL;IMGUI_IMPL_OPENGL_LOADER_GLAD;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;GLAPP_REQUIRE_OGL45;USE_THREAD_TO_FILL;USE_MAPPED_BUFFER;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
......@@ -581,6 +581,17 @@
<ItemGroup>
<ClCompile Include="..\..\src\emsTouch.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release OpenGL 4.1|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug noThread OpenGL 4.1|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug OpenGL 4.1|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release singleThread OpenGL 4.1|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release OpenGL 4.1|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug noThread OpenGL 4.1|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug OpenGL 4.1|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release singleThread OpenGL 4.1|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\libs\lodePNG\lodepng.cpp" />
<ClCompile Include="..\..\src\tools\fastRandom.cpp" />
......@@ -616,6 +627,7 @@
<ClInclude Include="..\..\src\emsTouch.h" />
<ClInclude Include="..\..\src\libs\imgui_markdown\imgui_markdown.h" />
<ClInclude Include="..\..\src\libs\lodePNG\lodepng.h" />
<ClInclude Include="..\..\src\libs\tinyPLY\tinyply.h" />
<ClInclude Include="..\..\src\tools\fastRandom.h" />
<ClInclude Include="..\..\src\tools\glslProgramObject.h" />
<ClInclude Include="..\..\src\tools\glslShaderObject.h" />
......@@ -665,6 +677,7 @@
<None Include="..\..\..\Shaders\oglAxesFrag.glsl" />
<None Include="..\..\..\Shaders\oglAxesVert.glsl" />
<None Include="..\..\..\Shaders\ParticlesFrag.glsl" />
<None Include="..\..\..\Shaders\ParticlesVert.glsl" />
<None Include="..\..\..\Shaders\PointSpriteFragLight.glsl" />
<None Include="..\..\..\Shaders\PointSpriteVert.glsl" />
<None Include="..\..\..\Shaders\RadialBlur2PassFrag.glsl" />
......
......@@ -45,6 +45,9 @@
<Filter Include="3th party Libs\imgui_markdown">
<UniqueIdentifier>{9e69864a-90a7-4701-8c3e-00e95f7112e0}</UniqueIdentifier>
</Filter>
<Filter Include="3th party Libs\tinyPLY">
<UniqueIdentifier>{5b720012-a29c-4444-bd2c-3551cb7b0bc7}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\colorMaps.cpp">
......@@ -253,6 +256,9 @@
<ClInclude Include="..\..\src\emsTouch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\libs\tinyPLY\tinyply.h">
<Filter>3th party Libs\tinyPLY</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\Shaders\BillboardFrag.glsl">
......@@ -300,6 +306,9 @@
<None Include="..\..\..\Shaders\ParticlesFrag.glsl">
<Filter>Shaders</Filter>
</None>
<None Include="..\..\..\Shaders\ParticlesVert.glsl">
<Filter>Shaders</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="..\ReadMe.txt" />
......
......@@ -94,7 +94,7 @@ void shaderPointClass::initShader()
selectColorMap(0);
useVertex(); useFragment();
getVertex ()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 1, SHADER_PATH "PointSpriteVert.glsl");
getVertex ()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 2, SHADER_PATH "ParticlesVert.glsl", SHADER_PATH "PointSpriteVert.glsl");
getFragment()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 2, SHADER_PATH "ParticlesFrag.glsl", SHADER_PATH "PointSpriteFragLight.glsl");
// The vertex and fragment are added to the program object
addVertex();
......@@ -119,6 +119,8 @@ void shaderPointClass::initShader()
#if !defined(GLCHAOSP_LIGHTVER)
idxSubLightOn = glGetSubroutineIndex(getProgram(),GL_FRAGMENT_SHADER, "pixelColorLight");
idxSubLightOff = glGetSubroutineIndex(getProgram(),GL_FRAGMENT_SHADER, "pixelColorOnly");
idxSubOBJ = glGetSubroutineIndex(getProgram(),GL_VERTEX_SHADER, "objColor");
idxSubVEL = glGetSubroutineIndex(getProgram(),GL_VERTEX_SHADER, "velColor");
#endif
ProgramObject::reset();
......@@ -185,6 +187,7 @@ void particlesBaseClass::render(GLuint fbOut, emitterBaseClass *emitter) {
glBindTextureUnit(0, colorMap->getModfTex());
glBindTextureUnit(1, texID);
glUniformSubroutinesuiv(GL_FRAGMENT_SHADER, GLsizei(1), &lightStateIDX);
glUniformSubroutinesuiv(GL_VERTEX_SHADER, GLsizei(1), &idxViewOBJ);
#else
glActiveTexture(GL_TEXTURE0+colorMap->getModfTex());
glBindTexture(GL_TEXTURE_2D,colorMap->getModfTex());
......@@ -197,6 +200,7 @@ void particlesBaseClass::render(GLuint fbOut, emitterBaseClass *emitter) {
#if !defined(GLCHAOSP_LIGHTVER)
glUniformSubroutinesuiv(GL_FRAGMENT_SHADER, GLsizei(1), lightStateIDX==1 ? &idxSubLightOn : &idxSubLightOff);
glUniformSubroutinesuiv(GL_VERTEX_SHADER, GLsizei(1), idxViewOBJ==1 ? &idxSubOBJ : &idxSubVEL);
#endif
updatePalTex();
#endif
......@@ -248,7 +252,7 @@ void shaderBillboardClass::initShader()
selectColorMap(1); //pal_magma_data
useAll();
getVertex ()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 1, SHADER_PATH "BillboardVert.glsl");
getVertex ()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 2, SHADER_PATH "ParticlesVert.glsl", SHADER_PATH "BillboardVert.glsl");
getGeometry()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 1, SHADER_PATH "BillboardGeom.glsl");
getFragment()->Load((theApp->get_glslVer() + theApp->get_glslDef()).c_str(), 2, SHADER_PATH "ParticlesFrag.glsl", SHADER_PATH "BillboardFrag.glsl");
......@@ -273,6 +277,9 @@ void shaderBillboardClass::initShader()
idxSubLightOn = glGetSubroutineIndex(getProgram(),GL_FRAGMENT_SHADER, "pixelColorLight");
idxSubLightOff = glGetSubroutineIndex(getProgram(),GL_FRAGMENT_SHADER, "pixelColorOnly");
idxSubOBJ = glGetSubroutineIndex(getProgram(),GL_VERTEX_SHADER, "objColor");
idxSubVEL = glGetSubroutineIndex(getProgram(),GL_VERTEX_SHADER, "velColor");
ProgramObject::reset();
#endif
......
......@@ -88,6 +88,11 @@ enum particlesSysyemType {
PS_MULTIPLE_EMITTER
};
enum particlesViewColor {
paletteIndex,
packedRGB
};
enum PS_FRAME_BUFFERS {
FB_BILLBOARD,
FB_POINTSPRITE
......@@ -363,6 +368,8 @@ public:
void showAxes(int b) { axesShow = b; }
int showAxes() { return axesShow; }
void viewObjON() { idxViewOBJ = GLuint(particlesViewColor::packedRGB); }
void viewObjOFF() { idxViewOBJ = GLuint(particlesViewColor::paletteIndex); }
#endif
int getWhitchRenderMode() { return whichRenderMode; }
......@@ -382,6 +389,8 @@ protected:
oglAxes *axes;
int axesShow = noShowAxes;
GLuint idxViewOBJ = 0;
#endif
cmContainerClass colorMapContainer;
......@@ -393,6 +402,7 @@ protected:
transformsClass tMat;
std::vector<GLuint> blendArray;
std::vector<const char *> blendingStrings;
......@@ -647,7 +657,7 @@ public:
flagUpdate = true;
//cmTex.buildMultiDrawFBO(1,256,1);
cmTex.buildFBO(1,256,2, theApp->getFBOInternalPrecision(), false);
cmTex.buildFBO(1,256,1, theApp->getFBOInternalPrecision(), false);
create();
}
......@@ -847,6 +857,7 @@ public:
float *getSelectedColorMap_pf3() { return colorMapContainer.getRGB_pf3 (colorMap->selected()); }
CMap3 &getSelectedColorMap_CMap3() { return colorMapContainer.getRGB_CMap3(colorMap->selected()); }
vec3 *getSelectedColorMap_vec3() { return colorMapContainer.getRGB_pv3(colorMap->selected()); }
float *getColorMap_pf3(int i) { return colorMapContainer.getRGB_pf3(i); }
const char *getColorMap_name() { return colorMapContainer.getName(colorMap->selected()); }
const char *getColorMap_name(int i) { return colorMapContainer.getName(i); }
......@@ -893,6 +904,7 @@ protected:
#if !defined(GLAPP_REQUIRE_OGL45)
GLuint locDotsTex, locPaletteTex;
GLuint idxSubOBJ, idxSubVEL;
#endif
enum lightIDX { off, on };
......
......@@ -908,6 +908,7 @@ void threadStepClass::newThread()
}
void threadStepClass::startThread(bool stratOn)
{
emitter->setEmitter(stratOn);
}
......
......@@ -37,6 +37,12 @@
#include "attractorsBase.h"
#define TINYPLY_IMPLEMENTATION
#include <tinyPLY/tinyply.h>
#if !defined(GLCHAOSP_LIGHTVER)
bool loadObjFile()
{
//string line;
......@@ -92,6 +98,268 @@ bool loadObjFile()
return true;
}
bool importPLY(bool wantColors)
{
attractorsList.getThreadStep()->stopThread();
char const * patterns[] = { "*.ply" };
char const * fileName = theApp->openFile(nullptr, patterns, 1);
if(fileName==nullptr) return false;
try {
std::ifstream ss(fileName, std::ios::binary);
if (ss.fail()) throw std::runtime_error(fileName);
PlyFile ply;