Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: Planet texture generation code

  1. #1

    Planet texture generation code

    Hi guys!
    Does anyone have some code for generating planets textures. If not any tutorial on this mater would be verry halpful.

  2. #2
    For a more general-purpose solution, Terragen can be quite useful. In Photoshop, one of the best texture generation tools is Filter Forge.

    Finally, you can create textures in code by calculating perlin noise. Doing so in real-time can be complicated, but on GPU it is quite a possibility.

  3. #3
    Do you know the "Sand game"? You can do something similar. Clean the texture to 0. Then "drop" a "sand grain", that is, select a coordinate and if there are a "lower land" around it let the grain "fall" to this lower place and start again. Add some random when you look around for "lower land".
    No signature provided yet.

  4. #4
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    I am working on some texture generating stuff as part of my framework.in the lower right is a typical noise fuction. all of these were created with a script which to me makes more since because of the tweaking involved to get the look right.the other advantage is that scripts are much smaller the actual bitmaps so they can be generated when needed rather then stored. in the future I hope to have a full array of noise functions and a real time editor to aid with script creation.
    Code:
    BITMAP4:TestMap = {400,400} []
    VECBYTE4:Blue = [0,0,200,255]
    VECINT4:Frame = [10,10,80,32]
    VECBYTE4:LiteBlue = [100,100,255,255]
    VECBYTE4:Red = [150,50,100,255]
    ARRINT:Weaved = {8}
      [%11110000,
       %10010000,
       %10010000,
       %11110000,
       %00001111,
       %00001001,
       %00001001,
       %00001111]
    ARRINT:Diamond = {8}
      [%10000001
       %01000010,
       %00100100,
       %00011000,
       %00011000,
       %00100100,
       %01000010,
       %10000001]
    ARRINT:Block = {8}
      [%00011000,
       %00011000,
       %01111110,
       %11100111,
       %11100111,
       %01111110,
       %00011000,
       %00011000]
    
    Map(TestMap,LiteBlue,Blue)
    Clear()
    SetMapTags(PenMode,Alpha)
    SetInk(Pattern,Weaved,GradSlot,Color1,Frame,100,10)
    Fill(Frame)
    SetInk()
    Smooth(Frame,1)
    Rectangle(Frame)
    
    MoveFrame(Frame,2,0)
    SetInk(Pattern,Block)
    Fill(Frame)
    SetInk()
    Smooth(Frame,1)
    Rectangle(Frame)
    
    Frame = [10,44,80,32]
    SetInk(Pattern,Block)
    Fill(Frame)
    SetInk()
    Smooth(Frame,2)
    Map(TestMap,Red,Blue)
    SetInk(Pattern,Diamond)
    Fill(Frame)
    SetInk()
    Map(TestMap,Blue,Blue)
    SetInk(GradSlot,Color1,Frame,40,12)
    Fill(Frame)
    Map(TestMap,LiteBlue,Blue)
    Rectangle(Frame)
    SizeFrame(Frame,-2,-2)
    Rectangle(Frame)
    
    Frame = [92,44,80,32]
    Map(TestMap,Red)
    SetInk()
    Fill(Frame)
    Map(TestMap,LiteBlue,Red)
    SetInk(Cloud,Color2,4)
    Fill(Frame)
    SetInk(Cloud,Color2,2)
    Fill(Frame)
    SetInk(Cloud,Alpha,1)
    Fill(Frame)
    SetInk(GradSlot,Alpha,Frame,40,12)
    Map(TestMap,Blue)
    Fill(Frame)
    Map(TestMap,LiteBlue)
    Rectangle(Frame)
    SizeFrame(Frame,-2,-2)
    Rectangle(Frame)
    http://www.dreamincode.net/forums/to...-perlin-noise/
    Attached Images Attached Images

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    procedurally generated would be quite neat and save you a ton of space for assets.

    You may have longer load times as result though.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6
    if you are on Gimp, you can try this ones:
    - http://gimp-texturize.sourceforge.net
    - http://fimg-gmplugins.sourceforge.net
    I guess that there is a perline somewhere in Gimp too.

    EDIT: in this place http://devmag.org.za/2009/04/25/perlin-noise/ you can find a way to create your own textures using perlin.
    Last edited by pitfiend; 02-04-2012 at 11:46 PM.

  7. #7
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    Quote Originally Posted by WILL View Post
    procedurally generated would be quite neat and save you a ton of space for assets.

    You may have longer load times as result though.
    Using scripts to create textures doesn't necessarily mean slow. if we are able to create a texture from a script then we could save that texture same as any. we can create and save textures as they are needed and dispose of them when they are no longer needed. because they are scripts they can be influenced by the game that uses them.

  8. #8
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    That's completely true. You could have the game detect the textures, if they are not found then generate the textures the first time it's ran.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #9
    Junior Member
    Join Date
    Mar 2012
    Location
    London, UK
    Posts
    27
    Quote Originally Posted by SilverWarior View Post
    Does anyone have some code for generating planets textures.
    What kind? A single large texture to wrap on a sphere? Or were you wanting interpolated texture maps? Also, from what distance? Close up, or the sort of thing you'd see in orbit around a planet?

  10. #10
    I will probably use Perlin noise for generating textures, hgeightmaps, etc.

Page 1 of 4 123 ... LastLast

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
  •  
Comodo SSL