Skip to content

Commit

Permalink
Merge pull request #137 in STRUC/icn3d from release279 to master
Browse files Browse the repository at this point in the history
* commit '2e8b910791d69bd81ddbdd8b38f68a8b8933555c':
  Fixed the effect of Fog on sticks and spheres
  • Loading branch information
jiywang3 committed Aug 1, 2019
2 parents c9760f8 + 2e8b910 commit e1036fb
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<b>Complete package</b> 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.
<b>Complete package</b> 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)

Expand Down
13 changes: 11 additions & 2 deletions icn3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,14 @@ <h2>iCn3D gallery <span style="font-size:0.7em">("iCn3D PNG Images", all images
</div>

<div class="gallery">
<a href="https://icn3d.page.link/aRyqxdcTWuUfJcYE6" target="_blank">
<img style="height:300px" src ="https://www.ncbi.nlm.nih.gov/Structure/icn3d/gallery/3GVU-aRyqxdcTWuUfJcYE6.png"><br>Ligand Binding (PDB 3GVU)
<a href="https://icn3d.page.link/WTtKKEaYkeMRE5nP7" target="_blank">
<img style="height:300px" src ="https://www.ncbi.nlm.nih.gov/Structure/icn3d/gallery/3GVU-b1-WTtKKEaYkeMRE5nP7"><br>Ligand Binding with Fog (PDB 3GVU)
</a>
</div>

<div class="gallery">
<a href="https://icn3d.page.link/4ZXgp2mSnXT8vbqf7" target="_blank">
<img style="height:300px" src ="https://www.ncbi.nlm.nih.gov/Structure/icn3d/gallery/3GVU-b2-4ZXgp2mSnXT8vbqf7.png"><br>Ligand Binding with Labels (PDB 3GVU)
</a>
</div>

Expand Down Expand Up @@ -1940,6 +1946,9 @@ <h3>Methods <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a></h3>

<a name="log"></a>
<h2>Change Log:<img src="https://www.ncbi.nlm.nih.gov/Structure/IMG/spacer.gif" width="25" height="1" border="0"><a href="#Top"><img src="https://www.ncbi.nlm.nih.gov/Structure/IMG/arrowup_blue.gif" width="12" height="12" border="0" alt="back to top"></a></h2>
<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.9.zip">icn3d-2.7.9</a> was release on August 1, 2019. Fixed the effect of Fog on sticks and spheres.
<br><br>

<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.7.8.zip">icn3d-2.7.8</a> was release on July 31, 2019. Fixed SNP annotation in the sequences and annotations window.
<br><br>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "icn3d",
"version": "2.7.8",
"version": "2.7.9",
"description": "iCn3D Structure Viewer",
"main": "index.html",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/icn3d/draw/impostor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/icn3dui/full_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/icn3dui/selection/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(",");
}
Expand Down Expand Up @@ -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(",");
}
Expand Down
16 changes: 15 additions & 1 deletion src/shader/CylinderImpostor.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"",
"}"
Expand Down
2 changes: 2 additions & 0 deletions src/shader/CylinderImpostor.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/shader/CylinderInstancing.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 14 additions & 1 deletion src/shader/SphereImpostor.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"",
Expand Down
2 changes: 2 additions & 0 deletions src/shader/SphereImpostor.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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;",
Expand Down
2 changes: 2 additions & 0 deletions src/shader/SphereInstancing.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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;",
Expand Down

0 comments on commit e1036fb

Please sign in to comment.