Add updated copyright notice

Add default marker colour
Add atom selection
parent 47e8857e
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
/*These licenses are compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
/*These licenses are compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
*/
/* Copyright 2017 Google Inc. All rights reserved.
......
......@@ -2,7 +2,7 @@
/*These licenses are compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
*/
/* Copyright 2017 Google Inc. All rights reserved.
......
......@@ -2,7 +2,7 @@
/*These licenses are compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
*/
/* Copyright 2017 Google Inc. All rights reserved.
*
......
/*# Copyright 2016-2018 The NOMAD Developers Group*/
/*# Copyright 2016-2018 Ruben Jesus Garcia Hernandez*/
/*
* Copyright 2016 Google Inc. All Rights Reserved.
*
......
/*# Copyright 2016-2018 The NOMAD Developers Group*/
/*# Copyright 2016-2018 Ruben Jesus Garcia Hernandez*/
/* Copyright 2016 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -735,12 +735,21 @@ int loadConfigFile(const char * f)
if (markers && !markercolours) {
markercolours=new float* [TIMESTEPS];
float mc [4];
if (fabs (BACKGROUND[0]-0.5) < 0.1 && fabs (BACKGROUND[1]-0.5) < 0.1 && fabs (BACKGROUND[2]-0.5) < 0.1) //almost grey
for (int j = 0; j < 3; j++) {
mc[j]=0.0f;
}
else
for (int j = 0; j < 3; j++) {
mc[j]=1-BACKGROUND[j];
}
mc[3]=0.5;
for (int i=0;i<TIMESTEPS;i++) {
markercolours[i]=new float[4];
for (int j = 0; j < 3; j++) {
markercolours [i][j]=1-BACKGROUND[j];
for (int j = 0; j < 4; j++) {
markercolours [i][j]=mc[j];
}
markercolours[i][3]=0.5;
}
}
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -3,7 +3,7 @@
/*This license is compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia-Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -33,14 +33,17 @@ const char * const AtomShaders [] = {
#endif
"uniform sampler2D atomData;\n"
"uniform float totalatoms;\n" //(float)atomsInPeriodicTable
"uniform int selectedAtom;\n"
"layout(location = 0) in vec3 center;\n"
"layout(location = 1) in float atomIn;\n"
"out vec4 vcolor;\n" //color , radius
"out vec3 vcen;"
"out float vselected;"
"void main()\n"
"{\n"
"float coord=atomIn/totalatoms+0.5/totalatoms;\n"
"vcolor=vec4(texture(atomData, vec2(coord, 0)));\n"
"vselected=float(gl_VertexID==selectedAtom);\n"
"vcen=center;\n"
"}\n",
......@@ -52,13 +55,21 @@ const char * const AtomShaders [] = {
#endif
"in lowp vec4 color;\n"
"in highp vec3 normal;"
"in float selected;"
"out lowp vec4 outputColor;\n"
"void main()\n"
"{\n"
"highp vec3 nn = normalize(normal);"
"lowp float a=abs(dot(nn, vec3(0,sqrt(2.0)/2.0,sqrt(2.0)/2.0)));\n"
"lowp float b=max(0.0, dot(nn, vec3(0,0,1)));\n"
"highp vec4 res=color;\n"
"highp vec4 res;\n"
"bool s=abs(normal.x)<0.2;"
"s=s||(abs(normal.y)<0.2);"
"s=s||(abs(normal.z)<0.2);"
"if (selected>0.5 && s)"
" res=vec4(1.0, 0.5, 0.0, 1.0);"
"else\n"
" res=color;\n"
" outputColor = vec4 ((res.rgb) * (0.4 + 0.3*a + 0.3*b), color.a);\n"
"}\n",
......@@ -73,8 +84,10 @@ const char * const AtomShaders [] = {
"uniform mat4 matrix;\n"
"in vec4 vcolor[];\n" //color , radius
"in vec3 vcen[];"
"in float vselected[];"
"out vec4 color;\n" //color
"out vec3 normal;\n"
"out float selected;\n"
"void main()\n"
"{\n"
......@@ -83,6 +96,7 @@ const char * const AtomShaders [] = {
"sin((gl_TessCoord.y-0.5)*pi));"
"vec3 vertex = normal * vcolor[0].w + vcen[0];\n"
"color=vec4(vcolor[0].xyz, 1);"
"selected=vselected[0];\n"
"gl_Position = matrix * vec4(vertex, 1);\n"
"}\n"
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -736,8 +736,8 @@ GLenum SetupUnitCell(GLuint *UnitCellVAO, GLuint *UnitCellVertBuffer, GLuint *Un
bool PrepareUnitCellAtomShader (GLuint *AtomP, GLuint *cellP, GLuint *MarkerP,
GLint *AtomMatrixLocation, GLint *UnitCellMatrixLocation, GLint *UnitCellColourLocation,
GLint *MarkerMatrixLocation, GLint *totalatomsLocation){
if (!PrepareAtomShader(AtomP, AtomMatrixLocation, totalatomsLocation))
GLint *MarkerMatrixLocation, GLint *totalatomsLocation, GLint *selectedAtomLocation){
if (!PrepareAtomShader(AtomP, AtomMatrixLocation, totalatomsLocation, selectedAtomLocation))
return false;
if (!PrepareUnitCellShader(cellP, UnitCellMatrixLocation, UnitCellColourLocation))
......@@ -749,7 +749,7 @@ bool PrepareUnitCellAtomShader (GLuint *AtomP, GLuint *cellP, GLuint *MarkerP,
return true;
}
bool PrepareAtomShader (GLuint *AtomP, GLint *AtomMatrixLocation, GLint *totalatomsLocation){
bool PrepareAtomShader (GLuint *AtomP, GLint *AtomMatrixLocation, GLint *totalatomsLocation, GLint *selectedAtomLocation){
//https://www.gamedev.net/topic/591110-geometry-shader-point-sprites-to-spheres/
//no rotation, only translations means we can do directional lighting in the shader.
//FIXME
......@@ -772,7 +772,12 @@ bool PrepareAtomShader (GLuint *AtomP, GLint *AtomMatrixLocation, GLint *totalat
eprintf( "Unable to find matrix uniform in atom shader\n" );
return false;
}
*selectedAtomLocation=glGetUniformLocation(*AtomP, "selectedAtom");
if( *totalatomsLocation == -1 )
{
eprintf( "Unable to find selectedAtom uniform in atom shader\n" );
return false;
}
return true;
}
......
......@@ -5,7 +5,7 @@
/*This code is therefore licensed under Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -36,8 +36,8 @@ GLenum SetupInfoCube (GLuint *VAO, GLuint *VertBuffer, GLuint *IndexBuffer);
bool PrepareUnitCellAtomShader (GLuint *AtomP, GLuint *cellP, GLuint *MarkerP,
GLint *AtomMatrixLocation, GLint *UnitCellMatrixLocation, GLint *UnitCellColourLocation,
GLint *MarkerMatrixLocation, GLint *totalatomsLocation);
bool PrepareAtomShader (GLuint *AtomP, GLint *AtomMatrixLocation, GLint *totalatomsLocation);
GLint *MarkerMatrixLocation, GLint *totalatomsLocation, GLint *selectedAtomLocation);
bool PrepareAtomShader (GLuint *AtomP, GLint *AtomMatrixLocation, GLint *totalatomsLocation, GLint *selectedAtomLocation);
bool PrepareAtomShaderNoTess (GLuint *AtomP, GLint *AtomMatrixLocation, GLint *totalatomsLocation);
bool PrepareUnitCellShader (GLuint *cellP, GLint *UnitCellMatrixLocation, GLint *UnitCellColourLocation);
bool PrepareMarkerShader (GLuint *MP, GLint *MMatrixLocation);
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -3,7 +3,7 @@
/*This license is compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
/*These licenses are compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
/*These licenses are compatible with Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -5,7 +5,7 @@
/*This code is therefore licensed under Apache 2.0*/
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
Purpose of this code:
The NOMADVR application can be used to visualize in virtual reality
different materials science datasets provided by NOMAD or final users.
Multiple platforms are supported by this code.
Context:
NOMADVR is provided in the context of the NOMAD Center of Excellence.
Datasets from the Encyclopedia and Archive are supported by NOMADVR.
Requirements:
-Supported virtual reality hardware: HTC Vive or Oculus Rift, GearVR,
Google Cardboard for Android or IOS, or the LRZ CAVE
environment.
Usage Instructions:
See https://www.nomad-coe.eu/the-project/graphics/VR-prototype
Subdirectories:
OpenVR: Demos for HTC Vive.
OculusMobile: Demos for GearVR.
GoogleCardboardAndroid: Demos for Google Cardboard (android)
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -6,7 +6,7 @@ Rub
Fix missing initialization, lines 379, 482
/*
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
#!/bin/bash
# Copyright 2016-2018 The NOMAD Developers Group
# Copyright 2016-2018 Ruben Jesus Garcia Hernandez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment