Following this article iv implemented a 2D Dynamic Cloud pixel shader into a Demo. Effectivly moving clouds which change shape. Full source is included.
Registriert: Mo Jan 31, 2005 11:02 Beiträge: 432 Wohnort: Rheinlandpfalz
Cool Demo!
I have to try that out, because I need something similar in my next project.
Thank you for sharing the source!
Greetings,
MatReno
EDIT:
On the same site you mentioned, there is a good article about rendering a sphere derived from a cube,
that doesn't have singularities at the pole. Maybe that helps you.
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Nice thing!
If you now implement this stuff with a depth-shading like effect, so that the thicker parts of the cloud appear darker if you understand what I want to say, this would be a really nice demo.
Greetings Lord Horazont
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Impressive. Is this kind of perlin noise but then calculated on the gpu?
Looking at the example screenshots lots more seem possible.
Considering the skydome have a look at this tutorial: http://www.flipcode.com/archives/Sky_Domes.shtml
Registriert: Di Okt 03, 2006 14:07 Beiträge: 1277 Wohnort: Wien
Hallo Stucuk,
Zitat:
BTW, does anyone know how to create dome's which don't suffer from anomalies at the pole's? (The texture converging on the pole bits)
This problem is imho caused by the way textures are normally put onto a sphere. The poles are mathematical singularities: the vertex on the pole is only one point and is assigned to the whole width of the dome texture which is practically not possible and therefore looks ugly - see picture1 below.
You can solve this problem if you can get rid of this singularity, that is, für example to take half a sphere and assign the texture in a planar way or by this LSCM-technique but NOT spherical - see picture2 below: it is stretched but has no singularity. The easiest way doing this is employing a modeller.
It is also possible to figure out a code that calculates the correct texture coordinates for the half sphere, but this is a little bit more complicated: e.g. "shoot" the vertices on a plane and then bring them into texture space.
Traude
If you now implement this stuff with a depth-shading like effect, so that the thicker parts of the cloud appear darker if you understand what I want to say, this would be a really nice demo.
My GPU Shading experience is vertualy non existant. I can make a shader work with an application, but i can't change/make them, Except for simple stuff like adding 4 more layers(Shader on the article only had 4, but his CPU based version used 8 ). Google also turned up nothing of interest on "depth-shading".
Zitat:
Is this kind of perlin noise but then calculated on the gpu
The 8 textures are made with a perlin noise. I never fully read exactly what happens in the shader part.
Looking at the screenshot on that page the skydome has the artifacts. The "Classic" way to do sphere's or domes is to have all the points converge on the 2 poles. The problem with this is it distorts the texture around the 2 poles which makes it look stupid in them areas.
define a 3D(or 4D if you need time too) perlinnoise function.
Then for creating the texture simply iterate over the texture coordinates and calculate the 3D coordinates from them (sphericalcoordinates with r=const to carthesian).
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Stucuk hat geschrieben:
Lord Horazont hat geschrieben:
If you now implement this stuff with a depth-shading like effect, so that the thicker parts of the cloud appear darker if you understand what I want to say, this would be a really nice demo.
My GPU Shading experience is vertualy non existant. I can make a shader work with an application, but i can't change/make them, Except for simple stuff like adding 4 more layers(Shader on the article only had 4, but his CPU based version used . Google also turned up nothing of interest on "depth-shading".
Ahm, you didn't understand me properly, and thats what I suspected while writing my post.
I had no words for the thing I wanted to describe... Uhm... What I mean is the following: If you look at a cloud outside (yes, there is a outside, I am suprised every time again ), it is not only a layer but a volumetric object. When the sun shines on it, the cloud is darker the more the light is scattered in it and gets "lost" in the water in the cloud.
And thats what you could have implemented if you had the needed skills in writing shaders.
Greetings Lord Horazont
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Registriert: Di Okt 03, 2006 14:07 Beiträge: 1277 Wohnort: Wien
Hallo Stucuk,
I had a longer look at the article mentioned by MatReno. The kind of calculation was a bit strange for me (because I always do it the other way round), but I think he does the following:
He comes from parameter space with the Interval [0,1]. That means for me, his beginning *IS* your u/v-coordinate. Then he scales and shifts that point so that it becomes a point on your cube front face. Now this result vector is normalized to be the sphere vector you need.
For example: u=0,v=0 (= the lower left corner of your texture)
Scale by 2 => gives (0,0)
Shift by (-1) => gives (-1,-1) and voila, you have the lower left corner of your cube front face (add the z-Coord of +1).
Normalizing (-1,-1,1) is (-0,577,-0,577,0,577) and this is your sphere point. By multiplying with any factor you can make it as big as you want.
For example: u=0,75, v=0,75
scale by 2 => gives (1,5 , 1,5)
Shift by (-1) => gives (+0,5,+0,5) = cube front face point
Normalizing (+0,5,+0,5,1) is (+0,408,+0,408,+0,816) = sphere point.
I understood you perfectly. I get the concept, just not how to implement it. I can't find any tutorials or articles on the subject.
Lord Horazont hat geschrieben:
And thats what you could have implemented if you had the needed skills in writing shaders.
If i had a million pounds i could buy a rearly expensive house. Without someone helping me(Which is ment to be the point of a forum, rather then just stating a person doesn't have the nessisary skills) by posting a link to a tutorial, article, etc then im not going to be able to "get the needed skills". I have for years been looking for articles and tutorials but any that i have found have eather only contained the theory behind them(which never goes into enough detail on how to implement the theory) or they just give you some nice maths equations and expect you to magicaly know how to implement it.
I do understand maths i.e b = a/c, a = bc, c = a/b, just not how to turn articles which doesn't explain what to do with the maths into a reality.
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Stucuk hat geschrieben:
Lord Horazont hat geschrieben:
And thats what you could have implemented if you had the needed skills in writing shaders.
If i had a million pounds i could buy a rearly expensive house. Without someone helping me(Which is ment to be the point of a forum, rather then just stating a person doesn't have the nessisary skills) by posting a link to a tutorial, article, etc then im not going to be able to "get the needed skills". I have for years been looking for articles and tutorials but any that i have found have eather only contained the theory behind them(which never goes into enough detail on how to implement the theory) or they just give you some nice maths equations and expect you to magicaly know how to implement it.
I do understand maths i.e b = a/c, a = bc, c = a/b, just not how to turn articles which doesn't explain what to do with the maths into a reality.
Oops, sorry, that came to you the wrong way. I didn't want to insult you in any way or sound arrogant or such things. I was referring to your post where you said that you have no skills. If you have questions on it, you can post them here, I think there will be people helping you
Greetings Lord Horazont
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
@Traude: So the 3d points are generated from the UV values? Then how do u get proper UV values . If your ment to use [0,0] to [1,1] for each face's uv then the texture won't align right on 2 of the faces (u can get 4 aligned but not the top and bottom ones).
@Lord Horazont: Do you know of any articles/tutorials/etc on "depth-shading like effects".
Mitglieder in diesem Forum: 0 Mitglieder und 6 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.