diff --git a/CHANGELOG.md b/CHANGELOG.md
index a4ae243e..67e61174 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,6 @@
## Change Log
+[icn3d-2.7.9](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.9.zip) was release on August 1, 2019. Fixed the effect of Fog on sticks and spheres.
+
[icn3d-2.7.8](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.8.zip) was release on July 31, 2019. Fixed SNP annotation in the sequences and annotations window.
[icn3d-2.7.7](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.7.zip) was release on July 30, 2019. Added the option to show or hide hydrogens when displaying PubChem compounds.
diff --git a/README.md b/README.md
index 0aa6cb77..48a48a76 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ We provided two types of iCn3D widgets: [basic interface](https://www.ncbi.nlm.n
Either of these widgets could be easily added to your own web pages as shown in the section of "Embed iCn3D with iframe or JavaScript libraries" below.
-Complete package of iCn3D including Three.js and jQuery can be downloaded from [https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.8.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.8.zip). The "Download ZIP" link in this page does not include third-party libraries.
+Complete package of iCn3D including Three.js and jQuery can be downloaded from [https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.9.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.9.zip). The "Download ZIP" link in this page does not include third-party libraries.
## [Gallery](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#gallery)
diff --git a/icn3d.html b/icn3d.html
index ec249054..c3b04602 100644
--- a/icn3d.html
+++ b/icn3d.html
@@ -508,8 +508,14 @@
iCn3D gallery ("iCn3D PNG Images", all images
+
+
@@ -1940,6 +1946,9 @@ Methods
Change Log:

+icn3d-2.7.9 was release on August 1, 2019. Fixed the effect of Fog on sticks and spheres.
+
+
icn3d-2.7.8 was release on July 31, 2019. Fixed SNP annotation in the sequences and annotations window.
diff --git a/package.json b/package.json
index 6d044dab..b534571e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "icn3d",
- "version": "2.7.8",
+ "version": "2.7.9",
"description": "iCn3D Structure Viewer",
"main": "index.html",
"scripts": {
diff --git a/src/icn3d/draw/impostor.js b/src/icn3d/draw/impostor.js
index 34cf1660..f4fc3f18 100644
--- a/src/icn3d/draw/impostor.js
+++ b/src/icn3d/draw/impostor.js
@@ -201,6 +201,7 @@ iCn3D.prototype.setParametersForShader = function (opacity) { var me = this;
if(this.opts['fog'] === 'yes') {
this.defines['USE_FOG'] = 1;
+
if(this.opts['camera'] === 'orthographic') {
this.defines['FOG_EXP2'] = 1;
}
diff --git a/src/icn3dui/full_ui.js b/src/icn3dui/full_ui.js
index 0d592eb7..472e2157 100644
--- a/src/icn3dui/full_ui.js
+++ b/src/icn3dui/full_ui.js
@@ -15,7 +15,7 @@ if (!$.ui.dialog.prototype._makeDraggableBase) {
var iCn3DUI = function(cfg) {
var me = this;
- this.REVISION = '2.7.8';
+ this.REVISION = '2.7.9';
me.bFullUi = true;
diff --git a/src/icn3dui/selection/commands.js b/src/icn3dui/selection/commands.js
index 4f556f09..5e86aa2a 100644
--- a/src/icn3dui/selection/commands.js
+++ b/src/icn3dui/selection/commands.js
@@ -1095,7 +1095,7 @@ iCn3DUI.prototype.applyCommand = function (commandStr) { var me = this;
var radius = parseFloat(paraArray[0].substr(paraArray[0].lastIndexOf(' ') + 1));
var nameArray = [];
- if(paraArray.length == 2) {
+ if(paraArray.length == 2 && paraArray[1].length > 4) { //sets a,b,c
var nameStr = paraArray[1].substr(paraArray[1].indexOf(' ') + 1);
nameArray = nameStr.split(",");
}
@@ -1292,7 +1292,7 @@ iCn3DUI.prototype.applyCommand = function (commandStr) { var me = this;
var threshold = parseFloat(paraArray[0].substr(paraArray[0].indexOf(' ') + 1));
var nameArray = [];
- if(paraArray.length == 2) {
+ if(paraArray.length == 2 && paraArray[1].length > 4) { //sets a,b,c
var nameStr = paraArray[1].substr(paraArray[1].indexOf(' ') + 1);
nameArray = nameStr.split(",");
}
diff --git a/src/shader/CylinderImpostor.frag b/src/shader/CylinderImpostor.frag
index 589a9726..e4eddd5f 100644
--- a/src/shader/CylinderImpostor.frag
+++ b/src/shader/CylinderImpostor.frag
@@ -294,7 +294,21 @@ $NGL_shaderTextHash['CylinderImpostor.frag'] = ["#define STANDARD",
" #include premultiplied_alpha_fragment",
" #include tonemapping_fragment",
" #include encodings_fragment",
-" #include fog_fragment",
+" //include fog_fragment",
+" #ifdef USE_FOG",
+" #ifdef USE_LOGDEPTHBUF_EXT",
+" float depth = gl_FragDepthEXT / gl_FragCoord.w;",
+" #else",
+" float depth = gl_FragCoord.z / gl_FragCoord.w;",
+" #endif",
+" #ifdef FOG_EXP2",
+" float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );",
+" #else",
+" float fogFactor = smoothstep( fogNear, fogFar, depth );",
+" #endif",
+" gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );",
+" #endif",
+"",
" #endif",
"",
"}"
diff --git a/src/shader/CylinderImpostor.vert b/src/shader/CylinderImpostor.vert
index 766498df..5f857736 100644
--- a/src/shader/CylinderImpostor.vert
+++ b/src/shader/CylinderImpostor.vert
@@ -37,6 +37,8 @@ $NGL_shaderTextHash['CylinderImpostor.vert'] = ["// Open-Source PyMOL is Copyrig
"varying vec3 V;",
"varying vec4 w;",
"varying float fogDepth;",
+"varying float fogNear;",
+"varying float fogFar;",
"",
"#ifdef PICKING",
" #include unpack_clr",
diff --git a/src/shader/CylinderInstancing.vert b/src/shader/CylinderInstancing.vert
index da66ed7e..31866b79 100644
--- a/src/shader/CylinderInstancing.vert
+++ b/src/shader/CylinderInstancing.vert
@@ -41,6 +41,8 @@ $NGL_shaderTextHash['CylinderInstancing.vert'] = ["// Open-Source PyMOL is Copyr
"varying vec3 V;",
"varying vec4 w;",
"varying float fogDepth;",
+"varying float fogNear;",
+"varying float fogFar;",
"",
"#ifdef PICKING",
" #include unpack_clr",
diff --git a/src/shader/SphereImpostor.frag b/src/shader/SphereImpostor.frag
index 99163c09..102feb8c 100644
--- a/src/shader/SphereImpostor.frag
+++ b/src/shader/SphereImpostor.frag
@@ -162,7 +162,20 @@ $NGL_shaderTextHash['SphereImpostor.frag'] = ["#define STANDARD",
" #include premultiplied_alpha_fragment",
" #include tonemapping_fragment",
" #include encodings_fragment",
-" #include fog_fragment",
+" //include fog_fragment",
+" #ifdef USE_FOG",
+" #ifdef USE_LOGDEPTHBUF_EXT",
+" float depth = gl_FragDepthEXT / gl_FragCoord.w;",
+" #else",
+" float depth = gl_FragCoord.z / gl_FragCoord.w;",
+" #endif",
+" #ifdef FOG_EXP2",
+" float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );",
+" #else",
+" float fogFactor = smoothstep( fogNear, fogFar, depth );",
+" #endif",
+" gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );",
+" #endif",
"",
" #endif",
"",
diff --git a/src/shader/SphereImpostor.vert b/src/shader/SphereImpostor.vert
index 04993990..4494d907 100644
--- a/src/shader/SphereImpostor.vert
+++ b/src/shader/SphereImpostor.vert
@@ -6,6 +6,8 @@ $NGL_shaderTextHash['SphereImpostor.vert'] = ["uniform mat4 projectionMatrixInve
"varying vec3 vPoint;",
"varying vec3 vPointViewPosition;",
"varying float fogDepth;",
+"varying float fogNear;",
+"varying float fogFar;",
"",
"attribute vec2 mapping;",
"//attribute vec3 position;",
diff --git a/src/shader/SphereInstancing.vert b/src/shader/SphereInstancing.vert
index b6495c33..f78c0b9f 100644
--- a/src/shader/SphereInstancing.vert
+++ b/src/shader/SphereInstancing.vert
@@ -6,6 +6,8 @@ $NGL_shaderTextHash['SphereInstancing.vert'] = ["uniform mat4 projectionMatrixIn
"varying vec3 vPoint;",
"varying vec3 vPointViewPosition;",
"varying float fogDepth;",
+"varying float fogNear;",
+"varying float fogFar;",
"",
"attribute vec2 mapping;",
"//attribute vec3 position;",