GLPlot.jl
GLPlot.jl copied to clipboard
Loading a mesh and creating screen capture
Hi Simon,
I'm working with mesh objects (from the Meshes package), and need to
- display a mesh in 3D, and
- take a screen grab to save as an image
- adjust camera (angle, position), and loop back to 2.
Can your package already do either of these? I think I can implement the first myself, but for the second and third I have no clue. I would really be handy if I could automate the "snapshot"ting of meshes. My goal of snapshots is to ultimately eventually create a movie of the surface rotating from a set of images.
I'm excited to finally get my simulation towards using your package. Let me know your thoughts.
Best regards, Alan
Oh cool :) Actually, just yesterday I implemented a better version of the mesh display! The rest should be relatively easy. Not everything is perfectly in place yet, but if you can supply me with some examples and more infos i can certainly give you a code snippet! On 13 Dec 2014 22:53, "Alan Bahm" [email protected] wrote:
Hi Simon,
I'm working with mesh objects (from the Meshes package), and need to
- display a mesh in 3D, and
- take a screen grab to save as an image
- adjust camera (angle, position), and loop back to 2.
Can your package already do either of these? I think I can implement the first myself, but for the second and third I have no clue. I would really be handy if I could automate the "snapshot"ting of meshes. My goal of snapshots is to ultimately eventually create a movie of the surface rotating from a set of images.
I'm excited to finally get my simulation towards using your package. Let me know your thoughts.
Best regards, Alan
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20.
Hi Simon,
Here is a surface that I'm evolving, at different timesteps, as visualized in meshlab http://meshlab.sourceforge.net/. I'm also attaching the .ply output from the simulation.
[image: Inline image 1]
Inside my julia code, I have a Mesh (from the great Meshes package https://github.com/twadleigh/Meshes.jl). I'm using the level set method http://en.wikipedia.org/wiki/Level_set_method to evolve an embedded surface. These are level sets from a cubic volume.
I just want a streamlined workflow, where I don't have to use meshlab (though it is very nice), and your package looks like it could do that for me. I just need it to allow me to load a Meshes.Mesh, (or a .ply), display from an angle and save a snapshot .png file to disk.
Does that help?
Alan
On Sat, Dec 13, 2014 at 2:00 PM, Sdanisch [email protected] wrote:
Oh cool :) Actually, just yesterday I implemented a better version of the mesh display! The rest should be relatively easy. Not everything is perfectly in place yet, but if you can supply me with some examples and more infos i can certainly give you a code snippet! On 13 Dec 2014 22:53, "Alan Bahm" [email protected] wrote:
Hi Simon,
I'm working with mesh objects (from the Meshes package), and need to
- display a mesh in 3D, and
- take a screen grab to save as an image
- adjust camera (angle, position), and loop back to 2.
Can your package already do either of these? I think I can implement the first myself, but for the second and third I have no clue. I would really be handy if I could automate the "snapshot"ting of meshes. My goal of snapshots is to ultimately eventually create a movie of the surface rotating from a set of images.
I'm excited to finally get my simulation towards using your package. Let me know your thoughts.
Best regards, Alan
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20.
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-66893253 .
Hi Simon, I didn't see github display the picture or attachments, so I'm re-forwarding directly. :-)
Alan
---------- Forwarded message ---------- From: Alan Bahm [email protected] Date: Sun, Dec 14, 2014 at 9:01 AM Subject: Re: [GLPlot.jl] Loading a mesh and creating screen capture (#20) To: "SimonDanisch/GLPlot.jl" < [email protected]
Hi Simon,
Here is a surface that I'm evolving, at different timesteps, as visualized in meshlab http://meshlab.sourceforge.net/. I'm also attaching the .ply output from the simulation.
[image: Inline image 1]
Inside my julia code, I have a Mesh (from the great Meshes package https://github.com/twadleigh/Meshes.jl). I'm using the level set method http://en.wikipedia.org/wiki/Level_set_method to evolve an embedded surface. These are level sets from a cubic volume.
I just want a streamlined workflow, where I don't have to use meshlab (though it is very nice), and your package looks like it could do that for me. I just need it to allow me to load a Meshes.Mesh, (or a .ply), display from an angle and save a snapshot .png file to disk.
Does that help?
Alan
On Sat, Dec 13, 2014 at 2:00 PM, Sdanisch [email protected] wrote:
Oh cool :) Actually, just yesterday I implemented a better version of the mesh display! The rest should be relatively easy. Not everything is perfectly in place yet, but if you can supply me with some examples and more infos i can certainly give you a code snippet! On 13 Dec 2014 22:53, "Alan Bahm" [email protected] wrote:
Hi Simon,
I'm working with mesh objects (from the Meshes package), and need to
- display a mesh in 3D, and
- take a screen grab to save as an image
- adjust camera (angle, position), and loop back to 2.
Can your package already do either of these? I think I can implement the first myself, but for the second and third I have no clue. I would really be handy if I could automate the "snapshot"ting of meshes. My goal of snapshots is to ultimately eventually create a movie of the surface rotating from a set of images.
I'm excited to finally get my simulation towards using your package. Let me know your thoughts.
Best regards, Alan
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20.
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-66893253 .
I'm still not seeing the image ;) But its okay, if I don't stumble upon any problems I'll push meshes support tomorrow. If you want to get a feel for the screen cast process, you can play around with the screenshot and timeseries function in GLPlot/src/util.jl. (Not exportet yet and in GLPlot master) You can use it like this:
using GLAbstraction, GLPlot, Reactive, GLFW
window = createdisplay(w=1920, h=1280)
# Take some signal to initiate the screenshot. For example pressing a button.
# You can use fps(30.0) to create a signal which fires 30 times a second.
lift(window.inputs[:buttonspressed], window.inputs[:framebuffer_size]) do buttonset, ws
if GLFW.KEY_S in buttonset
GLPlot.screenshot(ws)
end
end
Thanks!
On Sun, Dec 14, 2014 at 1:45 PM, Sdanisch [email protected] wrote:
I'm still not seeing the image ;) But its okay, if I don't stumble upon any problems I'll push meshes support tomorrow. If you want to get a feel for the screen cast process, you can play around with the screenshot and timeseries function in GLPlot/src/util.jl. (Not exportet yet and in GLPlot master) You can use it like this:
using GLAbstraction, GLPlot, Reactive, GLFW window = createdisplay(w=1920, h=1280)# Take some signal to initiate the screenshot. For example pressing a button.# You can use fps(30.0) to create a signal which fires 30 times a second.lift(window.inputs[:buttonspressed], window.inputs[:framebuffer_size]) do buttonset, ws if GLFW.KEY_S in buttonset GLPlot.screenshot(ws) endend
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-66931330 .
By the way, screenshot is an unsafe operation and I still don't really know, why its unsafe (besides that I don't check the window dimensions) Fact is, that it either just works, or it gave me a random segfault...
Do you want to animate the mesh itself, or just the camera? If yes, does the vertex count change? Do have any plans to color the mesh? You can send me the ply to [email protected] ;) Best, Simon
Okay, checkout GLAbstraction/master and GLPlot/meshes and you can look at examples/mesh.jl. The light model is still not correct, but it should give you a first impression.
Thanks! The code looks simple to use! As I run examples/mesh.jl at the moment I get: ERROR: error in method definition: function Color.RGB must be explicitly imported to be extended in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128 in reload_path at loading.jl:152 in _require at loading.jl:67 in require at loading.jl:51 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128 while loading /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl, in expression starting on line 146 while loading /Users/abahm/.julia/v0.3/GLPlot/src/GLPlot.jl, in expression starting on line 31
Can you try the new version? I can't reproduce it on 0.4 ;)
I can't upgrade to v0.4 just now - I'm in the middle of generating results. But I will before the end of the year. :-) thanks for all your work.
On Tue, Dec 16, 2014 at 8:49 AM, Sdanisch [email protected] wrote:
Can you try the new version? I can't reproduce it on 0.4 ;)
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67190870 .
Does it work now? It is supposed to work on 0.3 ;) No worries, its way more fun to develop when I know that it will be used!
On Wed, 17 Dec 2014 19:56 Alan Bahm [email protected] wrote:
I can't upgrade to v0.4 just now - I'm in the middle of generating results. But I will before the end of the year. :-) thanks for all your work.
On Tue, Dec 16, 2014 at 8:49 AM, Sdanisch [email protected] wrote:
Can you try the new version? I can't reproduce it on 0.4 ;)
— Reply to this email directly or view it on GitHub < https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67190870>
.
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67373053 .
:-)
Hmmm, now I see this:
ERROR: error compiling GLMesh: unsupported or misplaced expression => in function GLMesh in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:207 in glplot at /Users/abahm/.julia/v0.3/GLPlot/src/GLPlot.jl:38 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128 while loading /Users/abahm/src/beam-chemistry-code/DiamondEtch/display3d.jl, in expression starting on line 37
On Wed, Dec 17, 2014 at 11:17 AM, Sdanisch [email protected] wrote:
Does it work now? It is supposed to work on 0.3 ;) No worries, its way more fun to develop when I know that it will be used!
On Wed, 17 Dec 2014 19:56 Alan Bahm [email protected] wrote:
I can't upgrade to v0.4 just now - I'm in the middle of generating results. But I will before the end of the year. :-) thanks for all your work.
On Tue, Dec 16, 2014 at 8:49 AM, Sdanisch [email protected] wrote:
Can you try the new version? I can't reproduce it on 0.4 ;)
— Reply to this email directly or view it on GitHub <
https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67190870>
.
— Reply to this email directly or view it on GitHub < https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67373053>
.
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67376402 .
I should have tested it with 0.3! Well, I did now and hopefully its fixed! You also need to checkout the newest master of GLAbstraction and if you're on windows the same goes for ModernGL. Cheers, Simon
Hmmmm it fails on my main machine, a mac.
I have the master of GLAbstraction, GLWindow, ModernGL, and meshes of GLPlot.
My julia is: Julia Version 0.3.3 Commit b24213b (2014-11-23 20:19 UTC) Platform Info: System: Darwin (x86_64-apple-darwin14.0.0) CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge) LAPACK: libopenblas LIBM: libopenlibm LLVM: libLLVM-3.3
But, maybe it is machine specific? On my windows install of julia 3.0, it does seem to work, I see several curved triangles!
The error on the mac is:
1 #version 410 2 3 #extension GL_ARB_shading_language_420pack : enable 4 5 in vec3 o_normal; 6 in vec3 o_lightdir; 7 in vec3 o_vertex; 8 in vec2 o_uv; 9 10 11 const int diffuse = 0; 12 const int ambient = 1; 13 const int specular = 2; 14 15 const int bump = 3; 16 const int specular_exponent = 3; 17 const int position = 3; 18 19 uniform vec3 material[4]; 20 uniform vec3 light[4]; 21 uniform float textures_used[4]; 22 23 24 25 uniform sampler2DArray texture_maps; 26 27 28 29 vec4[4] set_textures(float texused[4], vec3 mat[4], vec2 uv) 30 { 31 vec4 merged_material[4] = { 32 vec4(mat[0],1), 33 vec4(mat[1],1), 34 vec4(mat[2],1), 35 vec4(mat[3],1), 36 }; 37 if(texused[diffuse] >= 0) 38 merged_material[diffuse] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[diffuse])); 39 if(texused[ambient] >= 0) 40 merged_material[ambient] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[ambient])); 41 if(texused[specular] >= 0) 42 merged_material[specular] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[specular])); 43 //merged_material[bump] = texused[bump] >= 0 ? texture(texture_maps, vec3(uv, texused[bump])) : vec4(mat[bump], 1); 44 return merged_material; 45 } 46 47 48 out vec4 fragment_color; 49 50 vec4 blinn_phong(vec3 N, vec3 V, vec3 L, vec3 light[4], vec4 mat[4]) 51 { 52 53 float diff_coeff = max(dot(L,N), 0.0); 54 55 // specular coefficient 56 vec3 H = normalize(L+V); 57 58 float spec_coeff = pow(max(dot(H,N), 0.0), mat[specular_exponent].x); 59 if (diff_coeff <= 0.0) 60 spec_coeff = 0.0; 61 62 // final lighting model 63 return vec4( 64 light[ambient] * mat[ambient].rgb + 65 light[diffuse] * mat[diffuse].rgb * diff_coeff + 66 light[specular] * mat[specular].rgb * spec_coeff, 67 1); 68 } 69 70 vec3 diffuse_lighting(vec3 L, vec3 N, vec3 Ld, vec3 Kd) 71 { 72 return Ld * Kd * max( dot(L, N), 0.0); 73 } 74 75 void main(){ 76 77 vec3 spec = vec3(0.0); 78 vec3 L = normalize(o_lightdir); 79 vec3 V = normalize(o_vertex); 80 vec3 N = normalize(o_normal); 81 82 vec4 mat[4] = set_textures(textures_used, material, o_uv); 83 84 fragment_color = blinn_phong(N, V, L, light, mat); 85 }
ERROR: /Users/abahm/.julia/v0.3/GLPlot/src/shader/phongblinn.frag WARNING: 0:3: extension 'GL_ARB_shading_language_420pack' is not supported ERROR: 0:31: '{' : syntax error: syntax error
in error at error.jl:21 in readshader at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:46 in GLProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:113 in TemplateProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:207 in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:213 in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:207 in glplot at /Users/abahm/.julia/v0.3/GLPlot/src/GLPlot.jl:38 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128
On Thu, Dec 18, 2014 at 2:18 AM, Sdanisch [email protected] wrote:
I should have tested it with 0.3! Well, I did now and hopefully its fixed! You also need to checkout the newest master of GLAbstraction and if you're on windows the same goes for ModernGL. Cheers, Simon
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67466534 .
Interesting.... Can you comment out the line with the extension? "//" for glsl comments... On 19 Dec 2014 19:38, "Alan Bahm" [email protected] wrote:
Hmmmm it fails on my main machine, a mac.
I have the master of GLAbstraction, GLWindow, ModernGL, and meshes of GLPlot.
My julia is: Julia Version 0.3.3 Commit b24213b (2014-11-23 20:19 UTC) Platform Info: System: Darwin (x86_64-apple-darwin14.0.0) CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge) LAPACK: libopenblas LIBM: libopenlibm LLVM: libLLVM-3.3
But, maybe it is machine specific? On my windows install of julia 3.0, it does seem to work, I see several curved triangles!
The error on the mac is:
1 #version 410 2 3 #extension GL_ARB_shading_language_420pack : enable 4 5 in vec3 o_normal; 6 in vec3 o_lightdir; 7 in vec3 o_vertex; 8 in vec2 o_uv; 9 10 11 const int diffuse = 0; 12 const int ambient = 1; 13 const int specular = 2; 14 15 const int bump = 3; 16 const int specular_exponent = 3; 17 const int position = 3; 18 19 uniform vec3 material[4]; 20 uniform vec3 light[4]; 21 uniform float textures_used[4]; 22 23 24 25 uniform sampler2DArray texture_maps; 26 27 28 29 vec4[4] set_textures(float texused[4], vec3 mat[4], vec2 uv) 30 { 31 vec4 merged_material[4] = { 32 vec4(mat[0],1), 33 vec4(mat[1],1), 34 vec4(mat[2],1), 35 vec4(mat[3],1), 36 }; 37 if(texused[diffuse] >= 0) 38 merged_material[diffuse] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[diffuse])); 39 if(texused[ambient] >= 0) 40 merged_material[ambient] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[ambient])); 41 if(texused[specular] >= 0) 42 merged_material[specular] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[specular])); 43 //merged_material[bump] = texused[bump] >= 0 ? texture(texture_maps, vec3(uv, texused[bump])) : vec4(mat[bump], 1); 44 return merged_material; 45 } 46 47 48 out vec4 fragment_color; 49 50 vec4 blinn_phong(vec3 N, vec3 V, vec3 L, vec3 light[4], vec4 mat[4]) 51 { 52 53 float diff_coeff = max(dot(L,N), 0.0); 54 55 // specular coefficient 56 vec3 H = normalize(L+V); 57 58 float spec_coeff = pow(max(dot(H,N), 0.0), mat[specular_exponent].x); 59 if (diff_coeff <= 0.0) 60 spec_coeff = 0.0; 61 62 // final lighting model 63 return vec4( 64 light[ambient] * mat[ambient].rgb + 65 light[diffuse] * mat[diffuse].rgb * diff_coeff + 66 light[specular] * mat[specular].rgb * spec_coeff, 67 1); 68 } 69 70 vec3 diffuse_lighting(vec3 L, vec3 N, vec3 Ld, vec3 Kd) 71 { 72 return Ld * Kd * max( dot(L, N), 0.0); 73 } 74 75 void main(){ 76 77 vec3 spec = vec3(0.0); 78 vec3 L = normalize(o_lightdir); 79 vec3 V = normalize(o_vertex); 80 vec3 N = normalize(o_normal); 81 82 vec4 mat[4] = set_textures(textures_used, material, o_uv); 83 84 fragment_color = blinn_phong(N, V, L, light, mat); 85 }
ERROR: /Users/abahm/.julia/v0.3/GLPlot/src/shader/phongblinn.frag WARNING: 0:3: extension 'GL_ARB_shading_language_420pack' is not supported ERROR: 0:31: '{' : syntax error: syntax error
in error at error.jl:21 in readshader at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:46 in GLProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:113 in TemplateProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:207 in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:213 in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:207 in glplot at /Users/abahm/.julia/v0.3/GLPlot/src/GLPlot.jl:38 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128
On Thu, Dec 18, 2014 at 2:18 AM, Sdanisch [email protected] wrote:
I should have tested it with 0.3! Well, I did now and hopefully its fixed! You also need to checkout the newest master of GLAbstraction and if you're on windows the same goes for ModernGL. Cheers, Simon
— Reply to this email directly or view it on GitHub < https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67466534>
.
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67678166 .
I commented out line 3 of the phongblinn.frag shader, and re-ran, the results are the same. But, is that the change you desired me to make?
On Fri, Dec 19, 2014 at 10:59 AM, Sdanisch [email protected] wrote:
Interesting.... Can you comment out the line with the extension? "//" for glsl comments... On 19 Dec 2014 19:38, "Alan Bahm" [email protected] wrote:
Hmmmm it fails on my main machine, a mac.
I have the master of GLAbstraction, GLWindow, ModernGL, and meshes of GLPlot.
My julia is: Julia Version 0.3.3 Commit b24213b (2014-11-23 20:19 UTC) Platform Info: System: Darwin (x86_64-apple-darwin14.0.0) CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge) LAPACK: libopenblas LIBM: libopenlibm LLVM: libLLVM-3.3
But, maybe it is machine specific? On my windows install of julia 3.0, it does seem to work, I see several curved triangles!
The error on the mac is:
1 #version 410 2 3 #extension GL_ARB_shading_language_420pack : enable 4 5 in vec3 o_normal; 6 in vec3 o_lightdir; 7 in vec3 o_vertex; 8 in vec2 o_uv; 9 10 11 const int diffuse = 0; 12 const int ambient = 1; 13 const int specular = 2; 14 15 const int bump = 3; 16 const int specular_exponent = 3; 17 const int position = 3; 18 19 uniform vec3 material[4]; 20 uniform vec3 light[4]; 21 uniform float textures_used[4]; 22 23 24 25 uniform sampler2DArray texture_maps; 26 27 28 29 vec4[4] set_textures(float texused[4], vec3 mat[4], vec2 uv) 30 { 31 vec4 merged_material[4] = { 32 vec4(mat[0],1), 33 vec4(mat[1],1), 34 vec4(mat[2],1), 35 vec4(mat[3],1), 36 }; 37 if(texused[diffuse] >= 0) 38 merged_material[diffuse] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[diffuse])); 39 if(texused[ambient] >= 0) 40 merged_material[ambient] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[ambient])); 41 if(texused[specular] >= 0) 42 merged_material[specular] = texture(texture_maps, vec3(vec2(uv.x, 1-uv.y), texused[specular])); 43 //merged_material[bump] = texused[bump] >= 0 ? texture(texture_maps, vec3(uv, texused[bump])) : vec4(mat[bump], 1); 44 return merged_material; 45 } 46 47 48 out vec4 fragment_color; 49 50 vec4 blinn_phong(vec3 N, vec3 V, vec3 L, vec3 light[4], vec4 mat[4]) 51 { 52 53 float diff_coeff = max(dot(L,N), 0.0); 54 55 // specular coefficient 56 vec3 H = normalize(L+V); 57 58 float spec_coeff = pow(max(dot(H,N), 0.0), mat[specular_exponent].x); 59 if (diff_coeff <= 0.0) 60 spec_coeff = 0.0; 61 62 // final lighting model 63 return vec4( 64 light[ambient] * mat[ambient].rgb + 65 light[diffuse] * mat[diffuse].rgb * diff_coeff + 66 light[specular] * mat[specular].rgb * spec_coeff, 67 1); 68 } 69 70 vec3 diffuse_lighting(vec3 L, vec3 N, vec3 Ld, vec3 Kd) 71 { 72 return Ld * Kd * max( dot(L, N), 0.0); 73 } 74 75 void main(){ 76 77 vec3 spec = vec3(0.0); 78 vec3 L = normalize(o_lightdir); 79 vec3 V = normalize(o_vertex); 80 vec3 N = normalize(o_normal); 81 82 vec4 mat[4] = set_textures(textures_used, material, o_uv); 83 84 fragment_color = blinn_phong(N, V, L, light, mat); 85 }
ERROR: /Users/abahm/.julia/v0.3/GLPlot/src/shader/phongblinn.frag WARNING: 0:3: extension 'GL_ARB_shading_language_420pack' is not supported ERROR: 0:31: '{' : syntax error: syntax error
in error at error.jl:21 in readshader at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:46 in GLProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:113 in TemplateProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:207 in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:213 in toopengl at /Users/abahm/.julia/v0.3/GLPlot/src/mesh.jl:207 in glplot at /Users/abahm/.julia/v0.3/GLPlot/src/GLPlot.jl:38 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128
On Thu, Dec 18, 2014 at 2:18 AM, Sdanisch [email protected] wrote:
I should have tested it with 0.3! Well, I did now and hopefully its fixed! You also need to checkout the newest master of GLAbstraction and if you're on windows the same goes for ModernGL. Cheers, Simon
— Reply to this email directly or view it on GitHub <
https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67466534>
.
— Reply to this email directly or view it on GitHub < https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67678166>
.
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67681132 .
The exact same error message? that would be really odd, as the error is specifically about this line...
It should have been in line 3 in /Users/abahm/.julia/v0.3/GLPlot/src/shader/phongblinn.frag
Sorry about this, but mac os is always a little odd concerning opengl...
The warning from line 3 is gone, but the error on line 31 is still there: The error now says:
ERROR: /Users/abahm/.julia/v0.3/GLPlot/src/shader/phongblinn.frag ERROR: 0:31: '{' : syntax error: syntax error
in error at error.jl:21 in readshader at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:46 in GLProgram at /Users/abahm/.julia/v0.3/GLAbstraction/src/GLShader.jl:113
On Fri, Dec 19, 2014 at 8:27 PM, Sdanisch [email protected] wrote:
The exact same error message? that would be really odd, as the error is specifically about this line... It should have been in line 3 in /Users/abahm/.julia/v0.3/GLPlot/src/shader/phongblinn.frag Sorry about this, but mac os is always a little odd concerning opengl...
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67724616 .
okay lets hope that this commit puts an end to this!
Yes! that worked on my Mac. Thank you so much!
On Sat, Dec 20, 2014 at 10:03 AM, Sdanisch [email protected] wrote:
okay lets hope that this commit puts an end to this!
— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/20#issuecomment-67744236 .