Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Sa Jul 05, 2025 20:19

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 22 Beiträge ]  Gehe zu Seite 1, 2  Nächste
Autor Nachricht
 Betreff des Beitrags: Dynamic Clouds Demo
BeitragVerfasst: Do Apr 10, 2008 06:11 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Following this article iv implemented a 2D Dynamic Cloud pixel shader into a Demo. Effectivly moving clouds which change shape. Full source is included.

Bild Bild

-Download ~328KB


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)

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Zuletzt geändert von Stucuk am Do Apr 10, 2008 11:47, insgesamt 1-mal geändert.

Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 09:30 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Geodetic domes are homogeneous constructed from triangles. May this is a possible base.

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 10:33 
Offline
DGL Member
Benutzeravatar

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! :D

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.

_________________
http://texelviews.delphigl.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 15:12 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Im just getting a "football" like effect when i try that article. Im proberly doing something wrong tho.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 15:27 
Offline
DGL Member
Benutzeravatar

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 networkmy 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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 19:30 
Offline
DGL Member
Benutzeravatar

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

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 20:55 
Offline
DGL Member
Benutzeravatar

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


Dateianhänge:
Sphere1.jpg
Sphere1.jpg [ 45.59 KiB | 12479-mal betrachtet ]
Sphere2.jpg
Sphere2.jpg [ 36.21 KiB | 12479-mal betrachtet ]
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 10, 2008 22:02 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
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 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.

Zitat:
Considering the skydome have a look at this tutorial: http://www.flipcode.com/archives/Sky_Domes.shtml

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.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Zuletzt geändert von Stucuk am Fr Apr 11, 2008 15:40, insgesamt 1-mal geändert.

Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 09:37 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Zitat:
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.

Iv implemented the Geometry side (Cube -> Sphere) but i have no clue how your ment to work out the texture coordinates.

-Download ~328KB

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 13:20 
Offline
DGL Member

Registriert: Di Jun 06, 2006 09:59
Beiträge: 474
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).

_________________
Bild


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 14:34 
Offline
DGL Member
Benutzeravatar

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 8). 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 :wink: ), 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 networkmy 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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 16:22 
Offline
DGL Member
Benutzeravatar

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 hope this will help a little bit
Traude


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 16:37 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Lord Horazont hat geschrieben:
Ahm, you didn't understand me properly

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.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 16:50 
Offline
DGL Member
Benutzeravatar

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 networkmy 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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Apr 11, 2008 18:11 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
@Traude: So the 3d points are generated from the UV values? Then how do u get proper UV values :P. 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".

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 22 Beiträge ]  Gehe zu Seite 1, 2  Nächste
Foren-Übersicht » English » English Programming Forum


Wer ist online?

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.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.019s | 18 Queries | GZIP : On ]