Page 2 of 2 FirstFirst 12
Results 21 to 37 of 37
  1. #21
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    riga, latvia
    Posts
    771
    Thanks guys for awesome replies.

    hello Simon!
    As I have now my own (together with mokazon) Blender development branch, I will try to get your sky implementation hardcoded in BGE, so I might have a bunch of questions
    I think this would be a beautiful Blender feature.

    Martins



  2. #22
    Having this hardcoded in blender would indeed be amazing.

    martinh, mokazon, you guys are awesome.



  3. #23
    how long did it take to unwrap the terrain i make big ones like that and i bet it takes over an hour



  4. #24
    I am wondering. What parameters did you use for the screen shots martinsh? On my AMD card it looks like this

    Last edited by Neox38; 25-Jul-12 at 23:17.



  5. #25
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    It looks that way on Blender 2.62 and later for some reason. I also tried it in recent SVN build from blender.org and a Swiss Cheese build from Graphicall, and had the same problem.

    Edit: Oops... this is not the problem. Martins said earlier in the thread it was because a python script was not running, and as others have stated, the problem occurs in 2.60 and 2.61 as well.
    Last edited by blendenzo; 08-Aug-12 at 23:41.
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  6. #26
    I wonder which build martinsh uses maybe the Blender Eye Candy build?



  7. #27
    Member 3d solar system builder's Avatar
    Join Date
    Mar 2012
    Location
    texas
    Posts
    1,902
    Originally Posted by blendenzo View Post
    It looks that way on Blender 2.62 and later for some reason. I also tried it in recent SVN build from blender.org and a Swiss Cheese build from Graphicall, and had the same problem.
    Mine shows up black also.



  8. #28
    Member GraphiX's Avatar
    Join Date
    Aug 2010
    Location
    Somewhere else
    Posts
    1,688
    Whenever I see a thread started by martinsh, I know I'll be thrilled. I still have yet to be proven wrong.
    "The world is in thought. Everything is still"



  9. #29
    Member martin.hedin's Avatar
    Join Date
    Jun 2012
    Location
    Las Palmas de Gran Canaria, Spain / Stockholm, Sweden
    Posts
    719
    I made a little tweaked version where the HDR is not white, I intend to use this one for exteriors, and light interior independently with the BGE Candy textured arealights build (realtime archviz) that you can find here: http://devlog-martinsh.blogspot.com/2012/11/bge-candy-area-lights.html

    2.64 version Blend (normal build, candy not necessary): http://www.pasteall.org/blend/17579
    Last edited by martin.hedin; 19-Nov-12 at 12:21.



  10. #30
    Member martin.hedin's Avatar
    Join Date
    Jun 2012
    Location
    Las Palmas de Gran Canaria, Spain / Stockholm, Sweden
    Posts
    719
    And here is the file that you should use with the Candy Arealights build: http://www.pasteall.org/blend/17584

    With one set of monkeys using light from the sky, the leftmost using arealights:
    skyarea.jpg

    All objects except ground using light from arealights:
    Attached Images Attached Images
    Last edited by martin.hedin; 19-Nov-12 at 12:56.



  11. #31
    Member martin.hedin's Avatar
    Join Date
    Jun 2012
    Location
    Las Palmas de Gran Canaria, Spain / Stockholm, Sweden
    Posts
    719
    It bothered my how nice the lighting from the arealights is, and how rough the lighting is defined in the ground.py. Also if you would like to illuminate objects with this set of python code, you do not get the lights from other sources.

    Then it occurred to me that the sun defined in sky.py is based on a light placed in space. So what I did was to crank up that lightsource and also changing it to an arealight, that with the candy build shades objects really nicely.

    The result is a lighting set-up, where the sky is defined by sky.py, and a terrain is defined by ground.py. But objects are using the normal BGE, but they are being lit by the arealight defining the sun position. Voila you can use all kinds of lights and also the sun from its correct position.

    The only problem is that we need a python script that can change the output of the arealight defining the sun so that it is not lighting up the geometry at night, output depending on position.

    And at the moment the sun is a square, but since you now can texture arealights you can have any shape you like!

    If you want to add more lights, remember to duplicate the sun arealight and delete the older one. The python scripts are using gl_LightSource[0].position for the sun, which will be the last light created.

    Blend: http://www.pasteall.org/blend/17586

    Use the Candy build, or the build found here: http://devlog-martinsh.blogspot.com....ea-lights.html
    Attached Images Attached Images
    Last edited by martin.hedin; 19-Nov-12 at 13:51.



  12. #32
    this area light implemantation of martins is pretty awesome.
    since he did not publish any code, i used the original implematation of Arkano22 to reproduce the effect for my engine.

    http://www.gamedev.net/topic/552315-...mplementation/

    i am getting a result but it is definitv incorrect. i can see the rectangle/lightsource but its position and direction are off.
    i use gl light input

    but what is that?

    vec3 right = normalize(vec3(gl_ModelViewMatrix*gl_LightSource[i].ambient)); vec3 pnormal = normalize(gl_LightSource[i].spotDirection); vec3 up = normalize(cross(right,pnormal));

    modelview * ambient color? does that make any sense?

    the rest seems to be pretty clear.
    martinsh can you give any hint. how you solved it for blender and how you optimized arkons code even more?

    any help apreciated



  13. #33
    How to set the sun's position (or rather which light source to follow)? It seems to be in relation with any random parented light source... In this case it follows my player's shadow spot light which is quite funny. The lower I get the darker it becomes.
    Last edited by MarvTheM; 02-Dec-12 at 11:21.



  14. #34
    Member martin.hedin's Avatar
    Join Date
    Jun 2012
    Location
    Las Palmas de Gran Canaria, Spain / Stockholm, Sweden
    Posts
    719
    The code specifies "gl_LightSource[0].position".

    It seems to be the last created light. Try to copy the sun SHIFT+D, and delete the old one.



  15. #35
    It worked. Thanks a lot! Seems like I didn't read your post above...



  16. #36
    Member martin.hedin's Avatar
    Join Date
    Jun 2012
    Location
    Las Palmas de Gran Canaria, Spain / Stockholm, Sweden
    Posts
    719
    My little tweak of the Preetham sky that you can find in Martinsh's BGE Racing Game.

    Download Shader!

    Preetham Sky 2k.jpg



  17. #37
    Member
    Join Date
    Jul 2008
    Location
    Los Angeles
    Posts
    23
    Thank you for the files! Your implementation is helping me tremendously. I tested with Blender 2.73. In BGE, the screen is completely white out of the box. However, if I start throwing scale factors (0.01) around, I can get the sky and ground to look good.

    gl_FragColor.rgb = scale_factor * tonemap(Lin+L0);
    Do you know why that scale factor must be added?

    I was struggling to find good references for the Preetham method. Your code saved my butt!



Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •