Search Unity

Planetary Terrain

Discussion in 'Assets and Asset Store' started by HenryV, Dec 4, 2013.

Thread Status:
Not open for further replies.
  1. blackanub1s

    blackanub1s

    Joined:
    Dec 12, 2013
    Posts:
    21
    I use "suimono" with "Planetary Terrain", it works more or less correctly.

    Moreover, it is the only package that works much.

    I was forced to recode the package C# as "suimono" unfortunately JavaScript.








     
    Last edited: Mar 11, 2014
  2. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Wow that looks awesome, but oh dear it is Java eh :(. How much work is it to rewrite it as C#? I'm really only a C guy, i've not touched JavaScript that much, but do it occasionally for work.
     
  3. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Sooooo, trying to get a collidable actor onto the screen is proving more difficult than I previously though. I imported the character controllers for unity, and applied the gravity scripts to them, but they keep falling alongside the side of the planet, and never using the planet as the "source" :'(.

    Is there something i'm missing? Do the 1st and 3rd person stock character controllers have a variable i should be overriding first?
     
  4. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212

    WOW ...nice job your planet looks really really good..


    I finally got my character walking on the planets surface...but now im getting some odd rotation issues when trying to use mouselook ..the whole character turns by itself ... it WILL walk on the surface and go in the direction I point the camera with the mouse but I get way too much "resistance" ...it doesn't want to walk in those directions..

    Don't know if I explained it properly.. I suck at programming.
     
  5. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    How did you get yours to walk on the surface and respect the terrain? I have him "Walking", but he seems to be walking on a different terrain than the one actually shown. So he'll start in the ground, and then as i move forward he doesn't respect any of the imperfections/hills/bumps/holes etc in the terrain. It is like he is walking on an invisible floor indepedant of the actual planet?

    Additionally, i had use a gravity script done by Faux since the one provided does not work properly whatsoever for a player :(.

    I've tried adding a Rigid/Mesh collider to the planet.....i've tried adding a Rigid/Mesh collider for the player model. Not sure what else to try so he will respect the terrain.

    I also tried two other gravity type player controllers to fix the issue, but all 3 are reflecting the same results despite two of them taking different approaches (one is based on an object, aka: planet, and the other is based on what is physically below your model's feet).

    So it seems something else is the issue here?


    ps: When my character loads in the terrain is constantly changing, and settles after a little while. Is this the LOD being fickle and/or being hyperactive?
     
  6. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    To be honest I used faux gravity..download the "example" in the description... https://www.youtube.com/watch?v=gHeQ8Hr92P4 ...I intend to make big modifications to the code ...

    I did exactly what he said to do in the video ..I made a capsule and placed it just above the ground on the planet ..attached the "Gravity Attractor" to the planet and then I attached the "Gravity Body" and "Player Controller" scripts to the capsule ... I added the planet as the attractor in the "gravity body" script ... I set the rigidbody on the capsule to continuous Dynamic collision detection ..I dragged the main camera into the capsule and put its position to X 0,Y 0.975,Z 0 I also made the capsule collider height 1.75.... I made sure collisions were turned on when I made the planet (colliders---->Generate Colliders) .


    Now my character walks around the whole planet without any issues(except the mouselook thing) ...all the way around even at the bottom(south pole) ... my issue is that I tried to add a standard mouselook script to the capsule(character) and its not turning with the mouse properly, it turns but then the character does some strange auto-rotating crap and I have to fight with it trying to get it to go in the direction of the camera ...most likely a programming issue ..haven't figured it out yet..

    Basically everyone is dead serious when they say you have to make a "custom" character to walk on planets... attaching any of this faux gravity code to a normal player character will make it "fly" or hover above the planet surface....
     
    Last edited: Mar 12, 2014
  7. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Yea i did all of that except for the dynamic continous detection. Maybe that is my issue and it isn't processing it correctly? Also, how many levels of LOD did you do? I did 15, so maybe my level 1 LOD isn't high or low enough to facilitate proper collision?

    I'll dig around, thanks for the reply, and i also tried that guy's gravity solution :). I may have found a nicer one that can be used for walking on walls and stuff for AI in the future.
     
  8. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    OK, so i've tracked down my collision issue on the planet's surface as being the LOD causing the problem.


    I want more detail at higher altitudes than what currently works for me.

    If I set my LOD to 10 levels, level 1 being 5000 and level 10 being around 9.765 my model clips through the terrain and follows an invisible terrain map.


    If i set my LOD to 7 levels, 1 being 200 and 10 being 3.125 I get a relatively good terrain collision and can follow mountains and curves, but i'm not 100% on whether or not that is perfect.


    How exactly does this LOD system work, point wise, as there is no level 0 that I can physically see or set, it is only 1 to X.

    Additionally, what should be the BEST LOD settings for relatively good look terrain at higher altitudes and maximum detail when i'm walking around with a capsule that is 1.75 in collision height, and 1 unit x,y,z in size?

    When I do 10 levels starting from 200, just like 7 levels starting from 200, the collider works relatively perfect (or as near as I can tell with limited testing).


    When I do 10, 15, 20, or 25 levels starting from level 1 at 5000 it, again, follows a mapping that doesn't exist.

    The reason why i want my LOD so high at level 1, even though i don't understand how it works currently, is because from orbit the planet looks amazing without any lag. However, when i set it to something like 10 levels of 200 it looks absolutely dreadful from altitude. Yet, the planetary collider won't work properly.


    Any ideas :(?
     
  9. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
  10. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Ah ...I didn't bother with LOD settings .. I am making my game on my laptop atm and I already use up 3.4 gigs of memory just making a planet with these mesh settings:

    Freq scale 2
    Radius 1000
    Height Variation 0.008
    Mesh Resolution 64
    Subdivisions 10
    Random seed 1

    I added 4 textures with normals and gave them Texture scale of 1000 XYZW

    That is all I did ..then got the character walking..

    I was planning on keeping it low detail without LOD but adding grass and trees and other details to it.. that might change later though..

    Thanks ..that is nice of you.
     
    Last edited: Mar 12, 2014
  11. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Yea, LOD will affect how laggy, or lack there of, it will be for you. The Stock LOD's are probably working well enough for you, but do this for me RQ just to see something. Go to your LOD manager, set the LOD levels to 1, then set the only LOD to 5000, then change the # of LOD levels to 10 and it should auto-scale the LOD settings for you, and then look at your planet's quality from orbit to see if it changed.


    Most likely since yours is a 10th the size of mine you won't notice a difference, but i wanted to check.


    Also, your ram usage is from having a mesh resolution of 64 and 10 subs, max i've ever gone to is 8subs, try 64/6 and mess around with your LOD settings.

    As for textures, what do you mean "with normals"? I haven't looked into texturing yet, only messed with some free ones i found online. Unfortunately even though they're made to "repeat-tile" you can see grid patterns form and it looks awful. Haven't looked into finding a way to fix that just yet.
     
  12. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Also, to keep things in perspective, if any game you make is using the 1 unit == 1 meter measurement than a planet with 1000unit, or 1000meter, radius actulaly has roughly 7808mi^2 of landmass. That's nearly 10x the largest game created to do that isn't procedurally generated.

    My issue, is that 10,000 units (meters) still seems relatively small with my little guy running around it. I may start a new project and try a 1000 radius planet and work with that for a bit to see how i feel about it. :cool:
     
  13. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Yeah it didn't change much ..slightly better looking but not much.
    Well I downloaded textures from http://www.cgtextures.com/ ..they are royalty free with a free account and used several of them in the "use textures" area of the planet ... it asks for bump maps if you click on "Use bump maps" I used normals for that ...just a normal map of some dirt with pebbles.

    Now there are details at surface level..
     
  14. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Did you use a tool to create your normal maps for the bump mapping? I saw someone using one in a video awhile back but can't seem to find it, or did you make them yourself in Photoshop?
     
  15. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    Hey guys, nice to see that you are working with the package!

    I want to give you a preview of the new demo scene included in the update which will be finished by the end of the week. It called "Massive", its a planet with radius of 50,000 units, featuring slightly warped terrain, a planetary FPS controller, atmospheric scattering by Aubergine (huge thanks!), improved BumpedPlanet shader and more.

    Webplayer

    $massive_screenshot.png

    The tree and foliage system is still very much in progress but I wanted to include trees to give some scale. I am having problems with the impostor generation (for some reason the leaves won't show up at all in the render textures and also the impostor textures generated with render textures work in editor but show up missing when creating a build, so the impostors are disabled.
     
  16. TheNorthridge

    TheNorthridge

    Joined:
    Jan 4, 2012
    Posts:
    193
    Wow! Thats Crazy!

    Obviously as you said, the trees and such are still early days. But its a good start!~

    I think you might have some better luck if you try integrating Unitys new standard FPS prefab, so everyone can know that they can use their own systems if needed.

    Also, maybe having a Player to Ship might also be cool, to see the scale of the planet!

    -Sean
     
  17. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Wow, very impressive... gonna purchase once you publish the update (maybe sooner).

    Any word on putting PT into it's own namespace? I plan to replace my SPACE for Unity planet with one from PT and I'm sure that will make things go smoother.
    :)
     
  18. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    Thanks for the nice comments!

    TheNorthridge Good ideas, I will see what I can do about them!

    GregMeach I will put in it the update but as I mentioned earlier I have already tried it and it broke the node serialization. So this means that all the old terrain module files cannot be loaded anymore. But I have also made some other modifications (to noise functions and how seeding works) that will change the outcome more or less, so I will probably just do it and recreate the modules (and make them better!).
     
  19. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    Is that an angle based texture i see in the demo??? That's AWESOME!!, thanks for getting that in there.
     
  20. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Wooo looks pretty =o, how does it look from space though? I can't seem to get the LOD where I want it AND have the model respecting the planet's surface in terms of collision.


    Also, never got an answer about my height issue for individual objects roaming on the surface D:!



    ps: Does the tree system have phasing so you can see psuedo-trees in the distance, and when you get close enough to change to higher quality trees?

    And, how hard would it be to spawn colliders for trees around you so you can't walk through them and you could interact with them?


    Cheers :)
     
  21. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    The massive demo is interesting but the new terrain texturing is not compatible with shader model 2.0 :(
     
  22. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Shader Model 2.0?
     
  23. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    Yep that it is, you're welcome. :)



    Hey, well you will see it from space soon. Sorry I couldn't figure out what your question was exactly so could you elaborate a bit or quote it? :p

    Yeah those are called "impostors" and yes I plan to have them but as I wrote there are currently problems with those so they are disabled.

    Well adding colliders shouldn't be that hard. The trees are rendered using direct draw commands (DrawMesh()) so they do not actually exist in the scene as gameobjects though. I think there probably should be a pool of colliders that are moved to the position of the closest trees.



    Yeah I had to change it to shader model 3.0 for all the features but I think it would be possible to have a lighter SM2 version too.

    It's a shader specification that determines how complex the shader can be, the higher ones are newer and more advanced. I think shader model 2.0 must be over 10 years old already but it is still used when targeting lower-end hardware.
     
  24. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    I use Shadermap 2 ... it makes ambient occlusion, displacement, normal, specular and detail maps out of any picture ..so you can throw in a pic of dirt with pebbles ...increase the detail and sharpness ...save it all to .png so unity can read it easily.

    link is here http://shadermap.com/home/

    I don't have any issues with "Space for Unity" and "Space Graphics Toolkit" with "Planetary Terrain" it all works good together ..no conflicts.
     
    Last edited: Mar 13, 2014
  25. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    It's from the last page I believe about LOD and models going through the planet if they move a little too fast.

    I need more info on how to properly calculate how many levels of LOD i need, and what they should be at for best/good looking detail at higher altitudes while at the same time following the proper planetary collision so that my models on the surface aren't following some invisible terrain that doesn't actually exist at that LOD.

    Not sure how else to rewrite what I already asked on a page or two ago :'(!


    For a more targeted answer could you answer the following post I made:
    http://forum.unity3d.com/threads/214961-Planetary-Terrain/page13?p=1551672&viewfull=1#post1551672

    I'm having issues with how LOD works, and how it affects the colliders. I have a 10,000 radius planet, and I want the planet to have good detail at high altitude, and best when walking on the surface. Additionally, the LOD is constantly shifting the planet's model when i'm running around on the surface and it's really aggitating to see turrain completely shift under my feet as i'm walking.

    Additionally, the LOD settings i have are not creating a proper collision map for the surface so sometimes my character will "bleed" into the floor or go through solid mountains because the correct LOD collider isn't being used.

    My problem seems to be how to calculate LOD based on the size and quality I want, and i was hoping you could give details as to how I should be properly scaling LOD, and how to figure out how many levels i should be using.

    So given a planet that is 64 Resolution, with 8 subs, and a radius of 10,000, how many levels of LOD should i have for good detail at highest altitude, while still maintaining best detail if i'm walking around on the surface all the while correctly modeling the collider's properly for the surface so my actors correctly respect the actual surface of the planet for collision purposes.
     
    Last edited: Mar 13, 2014
  26. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    @BES - thanks, that's good to know... now my wallet's going to be $90 lighter... :cool:
     
  27. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Has anyone found any asset packs or solutions for Atmospheric Distortion, HDR, and Volumetric Cloud systems that work with Planetoids?

    I've found that if I can get those 3 things working flawlessly with Planetary Terrain generated planets then the game just looks amazing.
     
  28. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    @TheBraxton

    Sorry I made you rewrite all that but wasn't sure exactly what you meant. Thanks for clarifying. :)

    I cannot give you a straight off answer what is the best LOD setup. I think you should experiment and find out what works best for you. But I can give you some examples: the massive demo above has radius of 50,000, mesh resolution of 32, subdivision 1, 10 LOD levels starting for 75,000 distance, colliders on level 8 and 9.

    Your example has pretty big numbers, I tried those settings and have around 6.5 million polygons on screen when the whole planet was in view from orbit. That much polygons is excessive and the additional detail should be added by using shaders (for which the default PT shaders are currently inadequate). The subdivision level can easily slow down performance and I usually leave it low for LOD setups and use higher number if I want a non-LOD planet.

    I think some of your collider problems might be because the colliders do not have time to generate but I have to say I also have found some issues with loading proper colliders for LOD levels in some cases. I have that fixed with the new update.

    I hope this helps!
     
  29. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    That is pretty cool ...thanks for the web player demo, great progress ... are you providing the character controller stuff too? ..since I cant get mine to work properly with the mouse :)
     
  30. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Ok cool thanks :)!

    Yea, i'm currently hunting for a shader solution that can be utilized in conjunction with PT. The problem is that most Shader solutions are all done by hand, or expect a flat 2x2 terrain so i'd have to spend months hand-painting any planet I create unless someone has found a shader solution that works for them so far with a PT created Planet?

    :)

    ps: I still need clarification on how to get current altitude from the walkable surface for any given object that can move/interact with the planet. I saw someone had found a way to get the height of a given area inside the PlanetaryEditor.cs stuff, but not really how to apply that to an object that is moving around on the planet's surface.
     
  31. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    So i just went back a couple pages to figure out if i could generate a height-map, and saw your post regarding RTP. I just looked at RTP and would REALLY like to buy it but didn't know if there was a way to create a height-map or splat to be used with RTP.


    Could I use RTP right now with PT, or are your changes for more control over heightmaps, splats, and texturing in general not done yet?

    It'd be awesome if PT becomes compatible with "most" major solution packages such as:

    -SUIMONO (haven't tested, but someone else said they got it working with PT)
    -RTP
    Maybe find the best solutions for the following:
    -Dynamic Clouds?
    -Weather based on pre-defined regions on a planet?
    -Atmospheric Distortions?
    -HDR?

    etc etc!

    So far Henry is providing some awesome support D: !
     
  32. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    I just put Colliders on 8 and 9 and my guy falls through the world :'(.


    Seems that no matter what i do only LOD Level 1 Collider will work, but if I do 15000 for level one it doesn't correctly handle the terrain collision :'(. There's got to be more to this than you're saying xD!
     
    Last edited: Mar 14, 2014
  33. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212

    I don't have a problem with the LOD levels or anything ..the problem im having is Unity's 32bit restriction ...if it were 64bit I would not keep crashing with out of memory errors on a computer with 64bit windows, 64bit CPU, and 16gigs of ram..

    Really wish they would get it 64bit capable already ... its highly annoying..

    EDIT: I am getting really bad flickering with the water shader ...annoying ...any way to reduce or get rid of the flickering?
    you can see it in this pic: http://www.pasteall.org/pic/show.php?id=68248 click on the planet to zoom..
     
    Last edited: Mar 14, 2014
  34. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    What size is your planet that you're not having LOD issues? Also, what are your LOD levels set to?

    Mine is 10,000 radius, and whatever radius I choose that isn't based on a level 1 of 200 just doesn't work properly. Even that one has some issues.

    edit: Forgot to say that I tried with LOD level start from 5000, 10000, 12500, and 15000, and the only collider that ever works is level 0 collider, but it is broken and i walk through mountains and stuff :(
     
    Last edited: Mar 14, 2014
  35. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Thanks to everyone that has contributed to this, I purchased PT yesterday and I've re-read this entire thread more than once. Hopefully once Henry releases the update my head will stop swimming in LOD, FAUX Gravity and RTP and atmospheric shaders, oh my!

    :cool:
     
  36. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Haha, yea.

    I'm still trying to fix my LOD issues, and also trying to find out how to obtain height. All examples of getHeight or getAltitude are using Raycasts. However, their terrain is set to a specific type of "Terrain", but ours seem to be different? None of the exmaples i've found for figuring out altitude above physical terrain below my character's feet are working.

    Additionally, when I do a raycast i hit untagged elements, but when i tagged the planet and all surfaces they still came back as "UnTagged". I then used "hit.transform.name" and it came back as Surface11(lol??).

    So my only choice at this point, which is an awful one, is to create an array of names for all surfaces and do an if statement on that array so i can do raycasts through objects i put on the world in order to hit only the terrain to figure out my altitude :(.
     
  37. HughieDM

    HughieDM

    Joined:
    Dec 8, 2012
    Posts:
    5
    Hey so I bought PT! I built a really quick scene today and wanted to share it!

    Planet Test

    so to move WS forward and back; AD strafe; and mouse left right turn

    So one thing that I learned is that you need to have collision at all LODs and have the collision disable when subdividing so that the highest subdivision has the correct collision other wise you walk through mountains. I have 5 LODs and Level 5 Generate colliders is on

    The player controller really needs some work! The mouse turn is way to sensitive and the animations are adding movement to the character!

    Any way enjoy!
     
  38. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212

    http://www.pasteall.org/pic/show.php?id=68250 <-- that planet is

    10,000 radius
    64mesh resolution
    4subdivisions

    LOD levels 100
    level 1 is 20,000
    level 100 is 3.155444e-26
    Simultaneous subdivisions are set at 2

    I only have 90 - 100 set to generate colliders

    The Hydrosphere is using a regular water shader with 1 dark blue texture tiled X150/150Y with a normal map tiled X50/50Y ... Diffuse is white and rim color is 54,57,34,255 (sort of a dark yellow color)

    The atmosphere is using an Atmo Xfade script(from the "BIG Environment Pack" asset) to control the color and brightness of the atmosphere.

    I actually didn't run the character on the surface yet ..but I am not expecting an issue with it since with 100 LOD stages the transition should gradual ..since there is not much load on the CPU when going all the way to the surface ..still getting 120FPS when up close looking at the highly detailed ground.

    And I just accidentally ruined my atmosphere by not paying attention and removing it ...I put it back in the scene but now it doesn't look right ...joy...
     
    Last edited: Mar 14, 2014
  39. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    Hey, have you tried the double camera setup such as in the demo scenes? The flickering is z-fighting between the water and surface and setting up separate cameras for close and far distances can help with that.



    Thanks to you for your support!



    The raycasting is a good solution to finding the distance from the ground. There is a possible fix that you could do to tag all the surfaces automatically.
    1. In Planet.cs find method InstantiateSurface() and after line "GameObject t = new GameObject..." place this line "t.layer = gameObject.layer;".
    2. And also in Surface.cs in method CreateSubsurfaces() find the same line "GameObject t = new GameObject..." and place the above line after that.
    Then you should have all surfaces set to same tag as the planet.


    Hey, nice to hear that and a good first scene!

    Good that you found a solution with the colliders but that was not how it was supposed to work, so it is a bug. It wastes processing resources to have to set the collision mesh to each intermediate LOD level. This should work correctly soon as the update hits!
     
  40. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    There are number of steps that currently have to be done to get it to work, but it is in the update so very soon it will be easy to replace the shader with RTP.
     
  41. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
  42. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Henry, can you share how you do impostors as in current state?
     
  43. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    The system automatically generates the impostor mesh and a texture from the original object when the application starts (the user has to supply parameter of the objects correct size on texture). It first creates a temporary camera that renders the object in to a texture and then generates the mesh where the texture is applied to. The mesh currently consist of two double-sided planes in cross formation (I might add a third plane facing up for viewing from above).

    At run-time the foliage renderer spawns tree instances to given LOD level surfaces and each update the renderer calculates distances to the objects and determines whether it should render the full mesh or an impostor. I think here could be another optimisation chance to group the objects so lesser amount of distance calculations would be needed.

    Here is what the impostor mesh looks like:
    $impostor_mesh.png




    Here are the same impostors rendered with "Nature/Tree Soft Occlusion Leaves" and "Unlit/Texture" shaders:
    $impostors_small.png
    (click for larger image)



    Can you tell where the impostors start?
    $impostors2_small.png
    (click for larger image)
     
  44. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Thanks for the replies so far Henry, cannot wait for teh updatezors :>.

    I'll try to layer changes soon and see if my raycasting resolves to actually work properly lol.

    Yay for RTP, as that seems like the absolute best texturing solution for PT :D, or at least from what i've seen.

    As for the trees, nice job! However, can they be set to a specific height layer? Like how textures are currently controlled? This way we don't get trees on mountains, or below areas they shouldn't be :).

    I'm also hopeful that once your tree system is done it can be slightly rewritten into a grass system :eek:!
     
  45. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    I did this, and I still fall through the planet.

    Levels 90 - 100 have their LOD colliders enabled.

    Still fall through :L, and if i just have level 0 and 1 enabled, then i walk through mountains.
     
  46. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    So, I added that code you said Henry, and they all still generate with the tag "Untagged". I believe because the Planet itself generates without a tag, therefore they take the "null" or "Untagged" tag from Planet.

    Additionally, I did a shift+select to get every single asset in the Hierarchy and set them all to tag = "Planet", and my Raytrace is still returning tag of "UnTagged" :(. So I believe my RayTrace is ignoring everything that is part of the planet, even the atmosphere.


    This is the test-code I was doing just in case i'm doing something wrong (completely believable lol):
    Code (csharp):
    1.  
    2. public void FindTerrainBelowMe()
    3.     {
    4.         if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.down),out hit))
    5.         {
    6.             if (hit.transform.tag == "Planet")
    7.             {
    8.                 BelowMe = "Ze Planeto!";
    9.             }
    10.             else if(hit.transform.tag != "Planet")
    11.             {
    12.                 BelowMe = hit.transform.tag;
    13.             }
    14.             else
    15.             {
    16.                 BelowMe = "???";
    17.             }
    18.         }
    19.         else{
    20.             BelowMe = "I hit nothing at all!";
    21.         }
    22.     }
    23.  

    This returns "Untagged" regardless of all objects in the scene being tagged as "Planet". Additionally, if i comment out the else-if it falls-through to the "I hit nothing at all!" which is odd considering it shouldn't.
     
    Last edited: Mar 15, 2014
  47. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    I accidentally gave you wrong instructions, I said you should write "t.layer = gameObject.layer;" but actually it is "t.tag = gameObject.tag;". So it didn't change the tag but the layer. Try if that helps!

    Seems there is something else wrong too if the raycast doesn't hit the planet. Are you sure the planet surfaces have colliders when you do the raycast? Also you could try using Debug.DrawRay() or Debug.DrawLine() to see if your ray is going where it is supposed to go.
     
    Last edited: Mar 15, 2014
  48. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Thanks, i'll work on that :)!
     
  49. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    I'm pretty sure it's just my lack of knowledge when it comes to Unity. I have that code in my "newController.cs" script that is attached to my capsule. Of whom is sitting on the side of my Planet's surface. I think I may just wait until the next update from you Henry before continuing to spin my wheels as my raycasting works in normal default scenes with a simple 2d Plane (I say 2D because for height you only have to worry about a relatively flat 2x2 plane of terrain to work with) which is what everyone uses in their examples/tutorials etc.


    :)
     
  50. HenryV

    HenryV

    Joined:
    Apr 25, 2012
    Posts:
    100
    Ok, the update will be out soon. One more thing if you want to try out related to the raycasting: you calculate the raycast direction with "transform.TransformDirection(Vector3.down)", while that should work it assumes that your transform is aligned so that down direction is towards the planet. You could try to raycast directly to the planet direction by calculating it with "(planet.transform.position - transform.position).normalized". Don't know if the problem is even related to the raycast direction but just something that came to my mind.
     
Thread Status:
Not open for further replies.