Well, I don't know if this idea has been posted before yet, if yes, any Admin can delete this Thread.
I don't know very much about Shader (How to write them, etc.) but maybe a Glow or Bloom shader makes clonk looking better ;). It would be quite nice if someone would implement this in OC.
Another idea, which has also something to do with shaders (I think so):
An object which has an Displacement texture, which will "displace the screen". Heres an example to see what I mean:
The Displacement-texture is like a Heightmap for an glasplate which is over the screen, and so the screen will be distorted.
It would be a nice effect for Hazard or Fantasy things.
I don't know very much about Shader (How to write them, etc.) but maybe a Glow or Bloom shader makes clonk looking better ;). It would be quite nice if someone would implement this in OC.
Another idea, which has also something to do with shaders (I think so):
An object which has an Displacement texture, which will "displace the screen". Heres an example to see what I mean:
The Displacement-texture is like a Heightmap for an glasplate which is over the screen, and so the screen will be distorted.
It would be a nice effect for Hazard or Fantasy things.
I also made this suggestion (http://forum.openclonk.org/topic_show.pl?tid=20) to use shaders in landscape drawing, but it was a problem of compatibility and also of the used graphics API.
I think we should wait until the developers have enough time to care about such stuff. (I myself can not take part of coding in OC because it's closed source yet.)
I think we should wait until the developers have enough time to care about such stuff. (I myself can not take part of coding in OC because it's closed source yet.)
But why don't you use GLSL? It is mor comfortable and i have some implementation of shader loaders and example 2d shaders.
OpenClonk will support OpenGL and DirectX.
GLSL only works for OpenGL.
(In my game project I am using GLSL too. :D)
GLSL only works for OpenGL.
(In my game project I am using GLSL too. :D)
Ideas about bloom and pixelshaders in general have been around for some time now. The issue is more to find someone who can implement it.
Additionally, the main problem here is that e.g. the displacement texture for a pixel-based landscape would have to be a second texture for the entire landscape since I think to generate it per-frame is too expensive. This would consume (too) much memory. The same applies for any other landscape-wide texture for shaders.
(The link is just made with POV-Ray and only to illustrate my idea)
Additionally, the main problem here is that e.g. the displacement texture for a pixel-based landscape would have to be a second texture for the entire landscape since I think to generate it per-frame is too expensive. This would consume (too) much memory. The same applies for any other landscape-wide texture for shaders.
(The link is just made with POV-Ray and only to illustrate my idea)
I think you missunderstood me with the displacementmap.
I thought about a "displacementmap for the screen", like when you see through a glassball or a lens.
I thought about a "displacementmap for the screen", like when you see through a glassball or a lens.
>The issue is more to find someone who can implement it.
Why don't you ask me?
(see Techdemo, link above)
the one_light.avi does not work (only a few KB)
>Why don't you ask me?
Well, feel free to fool around with the code in any way you want once it is open source :)
The video is DivX MS-MPEG-4 Version 3, you should be able to play it. I can even under linux :P
Wow, looks great! O_o *impressed*
[edit]
I implemented a Shader-Manager and a PostProcessing-System (GLSL) for my game.
It shouldn't be a problem to convert the code to CG. :)
*screenshot*
[edit]
I implemented a Shader-Manager and a PostProcessing-System (GLSL) for my game.
It shouldn't be a problem to convert the code to CG. :)
*screenshot*
> The issue is more to find someone who can implement it.
I think we first have to decide whether we use directX, openGl or both. Both would make it quite annoying to write shades since you'd always need two versions of them. There is a tool by AMD that can convert between those. I did not try it yet. (http://sourceforge.net/projects/hlsl2glsl)
I used to write some shaders in HLSL for a project. So if I had a look at the hopefully soon released source code, I might be willing to implement it.
Just because I'm interested in:
What did you use to model the landscape in POV-ray? A heightfiled?
If you or Carli know how to write shaders and would like to develop them for OC, I'd find that great!
Yes, I used a heightfield. The source is here.
Yes, I used a heightfield. The source is here.
can you put the video on yt pls?
i am writing this shader and it looks interesting (i could make a radial zoom f.e.)
i am writing this shader and it looks interesting (i could make a radial zoom f.e.)
VLC should be able to play that video. I don't really want to upload it to youtube.
i didn't want to download VLC so i uploaded the videos.
http://www.youtube.com/watch?v=_qMtmsCvfCo
http://www.youtube.com/watch?v=V3SDcJ1MytM
http://www.youtube.com/watch?v=_qMtmsCvfCo
http://www.youtube.com/watch?v=V3SDcJ1MytM
You also can watch it with QT, if you have installed the codecs.
This Techdemo raytraces a landscape and generates shadows (no aa implemented)
Needs gwX to run (used gwX graphics Engine for rendering shaders)
I hereby license the following file(s) under the CC-by license
(c) Carli
Needs gwX to run (used gwX graphics Engine for rendering shaders)
I hereby license the following file(s) under the CC-by license
(c) Carli
Attachment: Techdemo.zip (974k)
Unfortunately for both tech demos I get "Zugriffsverletzung bei Adresse 0045BC1B in Modul 'gwX.exe'. Lesen von Adresse 0000001C"
But anyway, the screenshots looks quite cool. Can you explain more in detail how it works?
But anyway, the screenshots looks quite cool. Can you explain more in detail how it works?
it is a raytracing algorithm checking a line of 32 pixels on the heightmap from the clonk to this landscape pixel. When a solid pixel is found, this pixel will be shadowed, else it would be lighted.
This shader works with unrolled iterations for downwards compatibility.
The shadowmap is not antialiased and it uses bias which means it generates oversized pixels. But it can be improved when you are interested in.
The "Zugriffsverletzung" may cause an old engine. Maybe you can try and find out why it does not work (i'm sorry for this bug - what for a system do you have and did you use setup? It would work on an older engine, maybe since rev5).
This shader works with unrolled iterations for downwards compatibility.
The shadowmap is not antialiased and it uses bias which means it generates oversized pixels. But it can be improved when you are interested in.
The "Zugriffsverletzung" may cause an old engine. Maybe you can try and find out why it does not work (i'm sorry for this bug - what for a system do you have and did you use setup? It would work on an older engine, maybe since rev5).
>This shader works with unrolled iterations for downwards compatibility.
Ah this explains why the shader looks so weird.
Considering the possibility of multiple light sources and the fact that for every (oversized) pixel one has to do a pathfree check to the light source it sounds far too expensive. Actually I think the Clonk landscape would be a classical case for bump or normal mapping - a flat surface which has a rough surface (tunnels and such) that is approximated by a bumpmap texture. However, this doesn't include self-shadowing. I think I once read an article about new technologies where self-shadowing with normal-mappy-stuff would be possible but I don't know how expensive this is.
How would it look like if the brightness of one pixel is calculated like L = D * A where D is the brightness of the light source depending on the distance to it and A is the direction of the normal of this pixel relative to the light (if it points to the light source its 1, if it is 90° its 0). So without cast shadows, just shading.
Then we have to generate a normalmap (i was not able to copy your povray example 'cause i had no normals for the landscape - and i was too lazy to generate them from the heightmap)
Now I continued my work on this Shader so it also enables embossing.
Watch at http://www.youtube.com/watch?v=hnvuIm7MgoE
Watch at http://www.youtube.com/watch?v=hnvuIm7MgoE
Attachment: Techdemo.zip (975k)
it's quite easy to rewrite a glsl shader in cg. (just read some tutorials.)
But I think as an OpenSourceProject (muhahaa the source isn't open) we should use OpenGL because DX takes no advantages towards GL
But I think as an OpenSourceProject (muhahaa the source isn't open) we should use OpenGL because DX takes no advantages towards GL
Hm. What happens, when you use more contrast? Something like LoS?
> I think we first have to decide
There's nothing to decide. When someone writes the shaders for ogl, we'll have ogl support and when someone writes the shaders for dx, we'll have dx support.
And if someone writes the shaders in Cg instead, we'll even have both! Whee!
No, it isn't. In this way we just wait for what people are willingly to code and not saying "we don't want you to code this or that".
Here some test maps if someone wants to try to implement lightning and shaders for normal & reflection maps. The normal map is actually not really good but it is not possible to create a better one with the from-photo-method. For a really good one, one would have to render the surface according to the texture and then render to normal map... but its just some test material anyway.
License: CC-BY 3.0
License: CC-BY 3.0
Attachment: red.zip (402k)
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill