View Full Version : Shadereditor experiment
Hi @ all,
because ther's no shadereditor for Linux, I've wrote my own... on the first pic I've create a Earthsphere with simple dot3 Bumpmapping (I've copy Colormap and Normalmap together in one texture) One the second I've load a OBJ file, that I exported from Blender.
How does it work?:
As first create a node, a script, two or more GLSL shaders (Vertex and fragment) and textures via contextmenu.
Then load a model, create a testobject or script OpenGL commands, to get something visible.
As last run the script.
Things that work:
Load & Editing shaders and scripts with simple highligting
Loading simple OBJ files (via script)
Create testsphere with Tangendvectors (via script)
Draw indexed an nonindexed VBOs via script. It's partly possible to modify these with scripts.
Implement a working save function
Implement more freatures
Add support for multipass rendering.
Add a stop button for render scripts.
Add Tools for modifiing meshes.
Better QSA performance. (A really fast CPU or a better scriptengine are more realistic)
NVX_instanced_arrays (I need that really. That's no joke, but nobody seems to know how usefull it is...)
29 Views? In this forum are to much bugreports.
Please move this topic to General Linux.
I noticed this is QT/KDE app so maybe you should post about it on kde-apps.org? Maybe there you will gain more response :)
Now multiple TMUs are working.
I've add new pic. That's a simple dot3 Bumpmapping with an additional unrealistic specular term :captnkill:
Maybe you will have more response when sourcecode is attached so people can try it themselves...
For recompiling use "qmake && make" the sorce depends to QT-3.3.x, QSA-1.1.x and Glew. Don't use QT4.x with QSA-1.2.x that doesn' work.
Start the program via shell "./gl" to see the GLSLcompiler warnings and errors.
All objects should have different names, because they are used by scripts. That's not checked jet. Rename objects using F2.
Testobjectscript: Only sphere is working.
OBJ importer: LWO name is wrong. Many OBJ files use multiple Indexstreams but that's incompatible to VBOs.
Don't close the cam.
A Simple Test:
Make a leftklick on the Wold and add a "node".
Add via Nodes contexmenu: Vertexshader, Fragmentshader, Script and a Texture
Texture : Load media/2kEarth_comp.jpg via contextmenu
Klick on the Node to select it, than run plugins/test_object.js from "Scripts" menu and say create.
shader = gl.Shader(Vertexshader,Fragmentshader);
varying vec3 T,B,N;
attribute vec3 Tangent;
varying vec3 col;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord = gl_MultiTexCoord0 * vec4(1,.5,1,1) + vec4(0.35,0,0,0);
N = gl_Normal;
T = Tangent;
B = cross (T,N);
uniform sampler2D Tex0;
varying vec3 T,B,N;
vec3 lvec= vec3(0.707,0,0.707);
vec3 nmap = -1 + 2* texture2D(Tex0, vec2(gl_TexCoord));
nmap = normalize(vec3(dot(T,nmap),dot(B,nmap), dot(N,nmap)));
float l = dot(nmap,lvec);
l += 1 * pow(max(dot(reflect (lvec,nmap),vec3(0,0,-1)), 0),4);
gl_FragColor =l * texture2D(Tex0, vec2(gl_TexCoord)+vec2(0,.5));
Then selelct "Run Script" from Scriptcontextmenu. You should see the dot3 bumpmapped earth.
Reliefmapping works now too. I've get some nice textures from here
that I use for rendering the attached pic...
A small update: DDS Files, Timebased animation and torus works.
Now I'm thinking what should add as next...
Multiple renderpasses and FBOs,
or something for better animation...
I've wrote a simple furshader :D
11-20-06, 09:27 PM
why not growing this into a sourceforge project? it looks really neat.
I've wrote a new shader for rendering fur. The new one is able to run on any GPU that have Pixelshader 2.0 capabilities. I the reliefshader part is replaced by a single texturelookup. With the 2 other lookups for normalmap an colormap it's need only 3 texturelookups instead many for a smooth reliefshading.
The compiled version needs 71 instruction in vf40 profile and ~81 in ps_2_0
12-02-06, 04:31 PM
really nice what you do ;)
please dont stop posting your efforts here
Changing the hair direction is now possible too. The next version should be able to read the direction from a texture... (hmm it's time to add the stanford bunny)
I've add a simple noisemodulation. I think it looks a little bit more realistic (16x AA clears all.
PS: fract(tan(float) * 43758.5453)*2-1 is a usable replacement for noise(float). sin() and cos() instead tan() are working too. That random numbers are good enough for graphics (but not for crypto....)
I've wrote a importer. The texcoords/tangents aren't very good so the image has many artefacs. Because the tangents aren't aligned, I couldn't change the hairdirection.
Last night I've installed QT4 and QSA1.2 (unfortunately it kills my QT3/QSA1.1 installation, so I can't recompile my old program). In the next days I'll port my code to the new QT version, so it would be able to run at windows too.
The model on the atached picture has round about 110K polygons.
My new roadmap for the next days:
Port to QT4
replace the MDI
Move the scripts from mainmenu to the items contextmenus
write more scripts
Porting to QT4 is slow :( . I have some troubles with removing Objects from the tree.
I'm also thinking about using the developers verion of QT that support QScript, which should be a QSA replacement in QT4.3 and it should run with a speed like Spidermonkey :D
80% of porting to QT4 is complete. The scriptlaucher is missing in this version, so it's impossible to load a model.
It would be nice if somebody could check if that code would compile on windows. Theoretical it should be plattform independent (maybe some changes in lumina.pro are needet)
Also I've registered my project at sf.net, but it will take some time. When it's done, I should have add the missing scriptlauncher.
My sf.net project is online:
I've loaded a new file up. The next step is to check if shadowalgorithms could run in Lumina.
I have uploaded a new version at sf.net http://sourceforge.net/projects/lumina/ (the new gear scripts aren't includet)
The same object as smal video http://cpux.de/gears.avi
I've uploadet a new relaise. The new version supports load and save and has a new DDS load with volume and cubemap support.
vBulletin® v3.7.1, Copyright ©2000-2015, Jelsoft Enterprises Ltd.