Dynamic Sky Questions

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Dynamic Sky Questions

Postby phoenix » Thu Jun 02, 2011 2:21 am

Hi One and All

Thanks to GPNMilano for the hard work you have been putting in. I see your replies all over the site, and just want to say thanks for the dedication.

I got a question which needs some good advice from the coders. I have been building a proto age with a skydome which mimicks earths atmosphere with a 24 hour day night cycle. My current progress I have is this:

The skydome rotates fine if the animation period is very small. This means however that the skydome rotates way too fast to be useful. The point is that it does work, so that is a step in the right direction.

Now, I have started delving into SDL states, but as a creator, I am finding it just so distracting diving into code when I am trying to focus on building the story. Noone seems to have written a simple tut from start to finish on using sdl states, and the dependancies that are needed, such as:

    - a pak file for the age and what it should contain - need advice on
    - the sdl file - done
    - the alscript in blender and how to properly label its contents - almost done, see below
    - a dummy python file for the age - almost done, need help on

And all of this while keeping a Blender focus!!

There is one tut about PlasmaShop (at http://www.guildofwriters.com/wiki/PlasmaShop) that skims over the subject like a pebble skipping over water. And the Global Animations: Day / Night Cycle (at http://dusty.homeunix.net/wiki/Global_A ... ight_Cycle) tut lacks a blender perspective. If I am missing a tut somewhere, please send me a link.

My next question regards alcscript in blender:

I have the alscript for the skydome setup, but lack one line. What goes in line 4?

1 <object>:
2 animations:
3 - type: ageglobalanim
4 name: <animation name> <-- what on earth is meant to go here???
5 globalvar: <SDL var name>

My last question is a twister. The skydome I have created has its axis parallel to the north south line (y axis). I want to offset this in Blender to 23.5 degrees just like planet earth. I am really stumped as how to offset rotation in Blender without wierd wobbles happening. Is anyone able to baby-step me through how to set that up?

I will be happy to share what I have learnt once I got a solution to this. Watch this space!

Later Explorers

Phoenix
User avatar
phoenix
 
Posts: 88
Joined: Wed May 19, 2010 2:29 am

Re: Dynamic Sky Questions

Postby GPNMilano » Thu Jun 02, 2011 6:28 pm

Phoenix,

phoenix wrote:hanks to GPNMilano for the hard work you have been putting in. I see your replies all over the site, and just want to say thanks for the dedication.


First, thank you for your recognition. It is always appreciated. :)

Second,

With Day Night cycles in ages things are much more trickier than they seem.

1. We can't right now do a true night-day cycle with the sky in Blender. PyPRP 2 should have this functionallity soon, (I Hope) and PlasmaMax of course does. But the older PyPRP versions did not have the neccessary components to do this properly. There are some private versions of PyPRP that do, but they break compatibility with the official versions which is why they were never implemented in the official download.

The good news is I should be able to help you rig up something similiar to what you're going for, though not as pretty as say Gira.

phoenix wrote:The skydome rotates fine if the animation period is very small. This means however that the skydome rotates way too fast to be useful. The point is that it does work, so that is a step in the right direction.


Okay first, I would suggest not rotating the skydome at all. If you want to have the clouds move etc, My suggestion would be to instead animate the texture, not the object itself. For how to animate a texture on an object you can start here: Animating Textures The animation won't be a global animation (since you can't currently export material animations as global animations (one of those things that are missing) however it's more sane then animating the object itself.

The problem then comes in that, you won't be able to animate it at exactly the time you need in the normal way. You'd start at frame 1, but the box only allows you to go up to 300000, and you'll need to go to frame 2592001. SO, what you'll do is animate it to say frame 10, and then edit each curve manually, so that it's end point is at 259,2001. So if you put the end frame at 10, you'd need to move it 259,1991 points along the x-axis. If you need help on how to do this just let me know and I'll put up some pictures on this thread to give you a general idea of what you need to edit etc.

Also, you'll want to animate your lamps in the age so that it affects the ground and all your objects, so that they are shaded with the cycle. The best way to do this is to use light groups, and attaching them to your objects. For a run down on how to do this I'd suggest the following tutorial. Light Groups It should give you a basic idea on how to set up your sun and moon so that they affect the object correctly.

If you don't have any lights currently set up in the age for the sun and moon I have a blend file thats currectly got an animation for just such a thing, and I'd be happy to share it with you to help you get started. Just let me know.

Also, for the <animation name> in the alcscript this is the name you wish to give the animation itself. You can name it whatever you wish. Cyan went with the same name as the globalsdlvar. So, if your age name was say Brama, I'd suggest bramaTimeOfDay. But that's just me. It can really be anything you want.
You can't stop the truth. IC Blog
User avatar
GPNMilano
 
Posts: 1155
Joined: Mon Apr 21, 2008 5:50 am

Re: Dynamic Sky Questions

Postby tachzusamm » Fri Jun 03, 2011 1:24 am

GPNMilano wrote:Okay first, I would suggest not rotating the skydome at all. If you want to have the clouds move etc, My suggestion would be to instead animate the texture, not the object itself.

Now this is interesting. It sounds like a valueable suggestion to me; but, may I ask, why?
Is it less resource-eating, gives smoother animations, promises less disadvantages in combination with other effects, or is this the only way to achieve very slow and lengthy skydome rotations?
A bit explanation would be greatly appreciated. :)
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: Dynamic Sky Questions

Postby phoenix » Mon Jun 06, 2011 7:52 am

Hi GPNMilano

Thanks for the hearty reply. I took a look at the "animating textures" tut, and here is where I hit the wall.


When building a model, uru wants not only a UV map, but also a material. Now this is where the tut gets confusing, because in one instance the writer refers to setting a material, and the other instance in animating a uvmap, as though they were interchangeable. From my experience with the engine, they are not, so I am stuck with creating a uvmap and at least one material for the example, but then this throws the tut right out of context for me.

Quote: "Currently only changing the UV mapping coordinates", but then the tut goes on to animate the "material".

If you are able to shed some light on this, you will really be making my day.

Thanks

Phoenix
User avatar
phoenix
 
Posts: 88
Joined: Wed May 19, 2010 2:29 am

Re: Dynamic Sky Questions

Postby tachzusamm » Mon Jun 06, 2011 9:32 am

Hi Phoenix.

I'm not sure if I am right here, but it's my impression that what confuses you is that you think about material and texture as independent things.
Actually, they are different, true, but neither "interchangeable" nor independent.

Let me try to explain.
Take a wallpaper as an example. A wallpaper in real life. Surely this consists of the texture, which defines the image printed on it, but it also consists of a material (in this case: paper).
So the whole surface we see is defined by the material (basic color, specularity, reflectivity), PLUS the texture (the detailed structure or printed image).

And this is how it's handled in Blender and URU too.

You *can* have a material assigned to an object's surface, without a texture (in case you only want to give the object a basic colored look), but you *cannot* have a texture applied to an object without a material.
(Imagine for comparison that the wallpaper needs paper as a material for carrying the image.)
And this is how it works in Blender and URU too: The material "carries" the texture.

So, when you are going to animate a texture, we can't talk about it without mentioning materials somehow. This is the reason the author of the wiki starts with applying a material first.

If you already have a material for your sky sphere, there's no need to add another material.

Now, why do we "animate a texture" by going with material animations?
This is because we're not going to influence properties of the texture itself (like color, brightness, contrast), but only its UV location - which is actually part of the material properties in Blender.
I know it's confusing in the first place, but once you understood it, it becomes pretty easy to remember.
When you are in the "Materials" buttons, you see all material properties: Material, Ramps, Links and Pipeline, Shader, Mirror Transp, Texture, Map Input, and Map To;
when in the "Texture" buttons, you see: Texture, Colors, Map Image, and Image.

Make sure you set the IPO Type to Material. If you are not animating the bottom layer, you will need to set the channel number next to the dropdown to show the curves for the appropriate layer. (the bottom layer is layer 0)

If this confuses you: Normally, if you have only one texture on a material, there's no "channel number" displayed. Just selecte "Material" in the IPO window, besides "View / Select / Marker / Curve".

I hope this helps a bit. :-)
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: Dynamic Sky Questions

Postby phoenix » Mon Jun 06, 2011 10:16 am

Hi Tachzusamm

Thanks for the walkthrough, it really has my brain spinning and I will need to crunch on this for a bit.

I am well versed in modelling (technical drafting, mesh, etc) but new to texture and materials, I admit I need to wrap my mind around it. Thus far this is how I have been doing it.

1) I create a material and pull its alpha value to zero. (So that after creating a uvmap in step 2, I can export it, without PyPRP grumbling)
2) Then I create a UV Map, so that I can get to see what the final will look like. (mostly to get a preview of the geometry)

If I understand you correctly, the uvmap sits on top of the material. So if I wanted to animate the uvmap texture, I have to indirectly animate the material it sits on top of??

Phoenix
User avatar
phoenix
 
Posts: 88
Joined: Wed May 19, 2010 2:29 am

Re: Dynamic Sky Questions

Postby tachzusamm » Mon Jun 06, 2011 11:20 am

phoenix wrote:If I understand you correctly, the uvmap sits on top of the material.

Umm, no.

You can have a texture sort of "on top of" another texture, but that's not how materials behave. With "carrying the texture" I did not mean there's an order.
Carrying here means that the texture needs something to belong to.
Imagine an apple with an "apple surface" texture, but you can still adjust the amount of the surface reflection with material properties (a glossy apple for example).
This would not work if the texture hides material definitions. Material properties still are effective when a texture is there.

phoenix wrote:So if I wanted to animate the uvmap texture, I have to indirectly animate the material it sits on top of??

Again no. You don't animate a material's position - because a material does not have a position. A material just defines properties.
What you do is actually to animate the position of a UV map directly. It's just the case that these UV map positions belong to the materials tab in Blender.

By the way, a "UV map" is not an image! The texture is an image. The UV map is technically just a bunch of 2D coordinates (U and V), which defines how to project a 2D image onto a 3D surface.
Like portions of a globe have to be distorted somehow to project them onto a flat map.
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: Dynamic Sky Questions

Postby bnewton81 » Tue Jun 07, 2011 12:18 pm

This is really a simply misunderstanding from where I'm sitting. Material = what a given thing/model is made of. Texture is harder to define, but here is goes. Texture is how a given thing/model looks or would feel if you could touch it. If you can come to understand what both material and texture means in everyday life, then you will have a good grasp of what they mean in Blender/Uru.

"Does a uv texture sit on top of a material?"

In many cases yes, but a texture can effect many attributes of a model. A model's normals, emittance(light giving properties), alpha(opaqueness), and many, many more. I think for your immediate purposes it is safe to tell you that a uv map is a picture affixed to a model. This is a drastic over simplification, but i think any more explination only serves to confuse people new to 3d modeling.

And the best way I've found to animate a texture is to animate a textures offset. That is done in the Map Input tab under materials.

This came very easy to me because i build and remodel homes, so there is always talk of "materials". Everything on earth is made of one material or another (wood, plastic, fiberglass, metal, glass, etc, etc). And when describing a material it is usually easier to start with its texture. You know, how it feels and looks.

This subject has been the topic of many books, so it would be impossible to explain here in any kind of detail. Forgive me if what I posted seems not to answer what you asked, but I have found that my difficulties in understanding how blender functions is usually do to my own ignorance of actual 3d objects. In short, understanding a 3d modeling program does not start in front of the monitor, but in close observation of things around you.
User avatar
bnewton81
 
Posts: 296
Joined: Sat Aug 28, 2010 3:24 pm
Location: Houston, Texas

Re: Dynamic Sky Questions

Postby phoenix » Sat Jun 11, 2011 3:33 pm

Hi Guys

Thanks for the walkthrough. I will chew on this for a while.

Phoenix
User avatar
phoenix
 
Posts: 88
Joined: Wed May 19, 2010 2:29 am

Re: Dynamic Sky Questions

Postby phoenix » Tue Jun 14, 2011 1:11 am

Hi All

Thanks to GPNMilano for the resource on how to animate a texture. I have managed to get a night skydome working very nicely. I have not yet put in group lights, but will get to that.

Now, a question for anyone who knows how to solve this next one.

I have mapped a skydome (ie:starmap) texture which has a ratio of 2:1 to a uvsphere. The problem is that the texture distorts quite a bit, and makes the skydome look, well... fake! I have used a blender tut on how to wrap a 2:1 texture on a 2:1 flat mesh to a uvsphere to avoid all the unwrapping hassles in blender, but dont seem to get the crispness of the final texture I require.

How do I get a crisp and detailed texture to wrap nicely to a uvsphere?

Phoenix
User avatar
phoenix
 
Posts: 88
Joined: Wed May 19, 2010 2:29 am

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests