I hopefully fixed the Intel bug. I have tested it with an Intel HD Graphics 4000. But sometime it will crash. I seems that Intel attach the shades randomly.
It is very important for Intel and ATI/AMD that are the latests drivers are installed. Legacy drivers will not work (no geometry extension).
I also added some new basic examples. GeometryShaderExample V1.2.blend (112 KB)
Small improvement. Using GL_CURRENT_PROGRAM to get shader program, which should be faster to get the actual shader program.
Added a new example. GeometryShaderExample_V1.3.blend (116 KB)
i’m with blueprintrandom i need this too. Also for grass, but can this produce somehthing like a VBO? can it and copies of itself?
i could so a lot with this if it works like i need. saw the file it really works first time seeing a working gs file. great work.
hey i put this in the gs but dont know how to send a different color to the frag shader. i just put some values anywhere to mess with it and i got some cool results
how would u send data to the frag shader. i tried messing with a varring var but its not compatible. can u show an example of different colors to the fragshader with the idea behind that code i posted? I was told by someone that this did work, but i now am very intrested again. if this works oh man… plz get back to me
the file has a few errors. it anyone can do this i would greatly apprieciate it. I just need someone to guide me. a simple straight though shader isnt the best example. I know i can read on the net how to do geo shaders, but i need a primer to see how blender handles the calls correctly. so i cant easily take off with it. in one night i got it to add a slew of objects, so i’m sure someone here knows how to do this. plz plz. this is an amazing work thanks HG1.
Sorry I made a fault. I don’t realized that there is an compile error.
I have updated the example.
what are ur plans with it by the way? u working on a game?
I don’t plans anything with it. I also don’t working on a game (I also nerve have made one). I have done this only because there always peoples who want geometry shader for the BGE. So I searched and found way to add them.
P.S. Don’t make double posts. Please use the edit function.
With geometry shades you can add or remove geometry objects (vertices). Which is not possible with the vertex shader, which can only modify the vertices. Look at the third shader where the objects are replaced with circles.
So it is possible to draw face or vertex normals, duplicate objects (e.g. grass ), adding particles, generate a single outline stroke, tessellate objects, dynamic LOD, draw a wireframe over an object and so on.
this opens up an untapped resource in blender. this file is sweet!! thanks this is just what i needed. i did that same thing but i used a varing vec2 texcoord[3] didnt think you could mix those. thanks again HG1.
Your graphic card support at least geometry shader V1.50.
this opens up an untapped resource in blender. this file is sweet!! thanks this is just what i needed. i did that same thing but i used a varing vec2 texcoord[3] didnt think you could mix those. thanks again HG1.
Yes you can mix varying and in/out. But above GLSL 1.20 varying is deprecated and if you want to use the GLSL 3.30 features you have to use in/out for the fragment shader.
is there anyway to make this easy for newbs to use?
like by adding empties with properties for where the instances are to be placed?
I am not sure what you mean by that. But I think you mean you want to use empties to define where the grass will be placed.
If you use a geometry sander it is easier to use an extra mesh to define it. On each vertex the grass will be generated.
Or more advanced you can use a stencil map to define where the grass should be placed.
Edit: @carlo697
Try one other scripts.
Your graphic card must support geometry shader 1.50 to get it working. Please check if your graphic card are supporting it. If yes try to update your graphic card driver.