Results 1 to 11 of 11

Thread: Clouds: How To?

  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Posts
    141

    Question Clouds: How To?

    So, I've been breaking my head on the issue of how to best render clouds in UDK. Not just background clouds but the kind you could potentially move through. Using textures and sprites is easy and is the accepted way of doing it, but it has issues with shading and tends to look really bad when "inside". Volumetrics would be ideal but they tend to be very fuzzy and has poor performance. Using lots of smaller particles can look better shading wise but isn't much better in terms of perf. I'm kinda stumped on this one.

  2. #2
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Posts
    141

    Default

    Alright, if it's of any interest to anybody, I cooked up an approach that seems semi-workable. It has a few issues with sorting but it looks pretty good otherwise.

    cloudslol.jpg

    Mesh on the left, particles on the right.

  3. #3
    MSgt. Shooter Person
    Join Date
    Jun 2008
    Location
    UK
    Posts
    167

    Default

    Using particle emitters will make it quite demanding and rather awkward to make it look nice. You might wanna try using 3d planes which move. Depends really on your style of game, are you going to be in the sky a lot if at all?

  4. #4
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Location
    Ventrilo
    Posts
    158

    Default

    Looks nice.
    The interesting part however, is the particle count.

    Any info on that?
    Last edited by HadHa; 08-12-2012 at 08:07 PM.

  5. #5
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Posts
    141

    Default

    About 20 or 30 for the sprite based one. Whereas the average cloud mesh seems to turn out with a couple of thousand polies. These clouds are generally intended to be the main environment feature, such as when flying. Mesh clouds have another advantage, which is that you can link a fog volume of the same shape to create the interior. The main problem is the fresnel opacity can tend to look quite fake. And as I said when using them in a particle system they do not sort at all. Whereas particles can sort very nicely with depth biased alpha on themselves.

    Currently experimenting with baking lighting into the mesh, mixed results: cloudslol.jpg

    What are these "3D planes that move" specifically?

    EDIT: Really the fakest looking thing about the mesh clouds right now is the "soft" fresnel edges. It would be nice if I could actually feather the alpha using a depth based edge detect, possibly add some noise to it as well. Is such a thing even possible with UDK materials?

    I'd also like to get them to self shadow but I just can't get them to cast or receive shadows of any kind. Static or dynamic.
    Last edited by BmB23; 08-13-2012 at 08:36 PM.

  6. #6
    Iron Guard
    Join Date
    Dec 2009
    Location
    South of cheese
    Posts
    775

    Default

    The best way would be if we could create our own scattered set of planes but have each plane be camera facing just like SpeedTree's leaf cards. I've seen it in borderlands with their strings of xmas lights and that is apparently a mesh. Though, I suppose that could be a speedtree, or 50 emitters...which makes no sense.

    I have tested this in speedtree using a cloud texture for the leaves and a void texture for the branches and it looks amazing...though I could not linear interpolate a speedtree actor and I wanted moving clouds.

    If anybody knows how to generate a mesh comprised of muliple planes AND have each plane in that mesh be individually camera facing, you could create some very nice clouds indeed and you would have a VERY easy time controlling the shape. If you combine that with flipbook atlases or SubUV's from pregenerated cloud animations, it could be quite dynamic.

    I've actually asked how we can create our own leaf cards multiple times to both the developers and to the forums and those posts have gone completely ignored so I'm assuming it's either not possible, nobody knows how, or people are being secretive...which is a mentality I don't share.

    This could very well be somethign that is protected for the sake of SpeedTree in order to force people to pay $11,500.
    Last edited by Hitpawz; 08-13-2012 at 09:08 PM.

  7. #7
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Posts
    141

    Default

    It would probably be a great deal easier if I actually knew HLSL.

  8. #8
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,763

    Default

    It would be easy to make leaf cards either from sprite components or a camera facing plane through unreal script. It would probably have to go through some manager class to protect performance. I believe it can also be done through material trickery.


    in tick or timer.
    Code:
    local MyHeroPawn MHP; 
    
    foreach WorldInfo.AllPawns(class'MyHeroPawn', MHP)
    {
       	TempRot = rotator(MHP.Location - Location);
    
    	SetRotation(TempRot);
    }
    Last edited by TheAgent; 08-14-2012 at 08:42 AM.

  9. #9
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Posts
    141

    Default

    So um, how are camera facing leaf cards any different from camera facing particle sprites?

  10. #10
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,763

    Default

    No clue, but just giving you the array of possibilities. I think an emitter spawning a glob of camera facing sprites will be the best choice.

  11. #11
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Posts
    141

    Default

    They shade extremely poorly though, and it's also very obvious that they are camera facing.


    Having stumbled upon this, I think I've been validated in my mesh approach. According to the associated paper, it's a fairly simple cloud model with two important features: A volumetric texture on the shell of the mesh, and a shader simulation of multiple forward scattering. (And yes, that is realtime) Basically fancier mie scattering. I'm not sure how exactly to go about it in UDK. I've already attempted to use a normal map for the diffuse with fairly good results. But the issue of how to properly filter or blur the alpha in order to look good around the edges stands. I have no real idea how to go about this and it's basically the only thing that keeps these clouds from looking pretty good. DX11 SSS could probably do the scattering well enough. Ultimately I may have to use custom lighting which I have no idea how to operate.

    There's still the issue of shadows. For static scenes you can trick it by using a solid material while building the lighting, but getting it to build translucent shadows or use dynamic shadows simply doesn't seem to work. :/ At any rate shadows is not extremely important but it certainly would be nice.

    I noticed speedtree apparently uses masked polygon "fins" on the edge of the trunk to simulate the rough bark texture: http://http.developer.nvidia.com/GPU...ems3_ch04.html Maybe something similar could be used for the edge of clouds? But again, no idea how to do it. Can you even generate geometry in UDK?


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.