Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

279 Excellent

About Lilleman

  • Rank
    Spacecraft Engineer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The two other cameras are already initialized when I need them, I thought it would be an easy way to get these two cubemap in the final reflection cubemap //Skybox ScaledCamera.Instance.galaxyCamera.RenderToCubemap(rtex); //Scaled space ScaledCamera.Instance.cam.RenderToCubemap(rtex); //Scene //(...) Instead of setting the culling mask and position each time. But I realized this afternoon after testing a bit more that I don't have enough control on these cameras. There's something I didn't tried yet in your snippet. I will make the camera render the terrain before the scaled
  2. Made small progress. It's still a lot of trial and errors at this point. Got inspired by this http://forum.unity3d.com/threads/shadow-fadeoff-approaching-far-clip-plane.356893/ , and found a way to use the original cameras to render cubemaps. So, to get the galaxy skybox, I can use ScaledCamera.Instance.galaxyCamera.RenderToCubemap(), and to get the ground skybox, I can use ScaledCamera.Instance.cam.RenderToCubemap(). If I replace my reflection probe by a camera, I'll have three cubemaps... And no idea on how to make them blend nicely (I need to blend day/night cubemaps, then ad
  3. Hard to explain (my poor english level don't help). For me it's normal to modify these variables, because I know exactly how they will react, and how the engine will (or should) render them. But I'm afraid that modifying some contrat and brightness values to get a mask could be confusing. Should've mentionned the mask is created in real-time, so you can see your changes directly, and save it from the game. You probably won't use it if you make your textures in an external editor. This is not a intended to give perfect results, but it should be good enough to convert simple parts mods
  4. Thanks. I've read this article already, but it kinda contradict the Unity's materials charts, Where the charts advice is to keep this value pretty low (light-grayish). The idea is the same, though. The code above, despite being simple, can provide this kind of results. I guess my question should be : What kind of parameters should be able for modders to use?
  5. I'm rewriting pretty much everything, to include the changes from the latest parttools release. It means this mod will be able to replace more parts shaders (like the OscarB fuel tank), but this also means the shaders will need KSPLighting.cginc to be compiled, and I can't include this file with the sources. I'll add another readme file to explain how to set up the editor folder to compile them. I have a quick question regarding the tool I want to implement: Where can I find some decent algorithms to convert a diffuse texture to metal/gloss/occlusion values (I can also have access to
  6. I hope you've got a backup of you original Squad folder... To install it, you just need to unzip the archive in the GameData folder, like any other mod. the masks textures should stay there, otherwise the mod won't load them. You can check if the mod is loaded correctly in the main menu (it should log some infos), and in a flight scene (the "PBR SL" icon in the toolbar). The current masks are made to look like the vanilla game. I plan to add some tools to modify them in-game shortly, but until then you'll have to make them by hand.
  7. The sky is reflected on the launchpad and the runway, where the vessel spawn. It happen on a small distance, the sky stop being reflected once the probe get out of this cube. I guess this one is the "atmosphere" sky box. I suppose it's always placed at vessel's position when a flight scene start, but after that it doesn't move (the position is probably refreshed with scaled space). If I can make it follow the vessel, it could solve the skybox problem, but I'm not sure if the game will like it.
  8. That's what it looks like, but it shouldn't be happening: at the moment, it's still a simple reflection probe, supposed to be attached to the vessel's root part... I realize the last updates were only to make it work, without success so far. I'll focus a bit on something else for the next release(clean the code and add a few functions). Got a bit bored of trying to make reflections work with vessels, so I'd make them not work with planets, too! (glitches may have been cropped from this screenshot)
  9. The renderprobe object itself is the most "transparent" way to get this working, but it seems to have too much limitations at the moment, compared to a camera, to render a cubemap. I tried to render a cubemap following this script http://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html but it got the same problems( rotated textures, and terrain not reflected). Though I probably should've used TR sources instead, I really didn't expect it to work on first try... @nli2work What's happening in this last vid? V0.04 Changelog : -Added an UI in fl
  10. GlobalBrightness and saturation should affect only albedo, not reflections. In the original standard shader this line is just "o.Albedo = c.rgb;". It's not really color saturation, either. more of a contrast. And the the textures tends to become dark with this, hence the GlobalBrightness value. The default in the config file should be "1.0" for these two variables. To compile a shader, import it in Unity, select it, and you should have "Compile and show code" in the inspector. Click on the arrow next to it to select only the platforms we need (OpenGl & DirectX9/11/11_9x),
  11. Thanks, I'm looking for this kind of snippets right now. I'm getting better with Unity but I still have a lot to learn about KSP scenes. I made a quick modification on specular shaders Forgot to include them in the last build, but I'll do it for next version. You can extract the compiled versions to the mod if they work as you expect (instead of being "globalShininess * Specularcolor", the specular output is now "diffuse.alpha * SpecularColor"). https://www.dropbox.com/s/si0df9kd4glirfc/specularshaders.zip?dl=0 Small update, so it does not get a real version inc
  12. That's some useful informations, thanks! I does not solve the problem of the terrain's reflection, but now I can prevent it to render the navball, the IVA view, and ship's parts (this also means close ships won't be reflected...) The reflection probes will use layer 9 (atmosphere), 10 (Scaled scenery), 15 (local scenery), and 23 (not in the link, but it's used for distant celestial bodies) . Also not in the link, the navball is on layer 25. It's a bit better now, if it wasn't for the terrain and flipped faces glitches. I made a quick search for the flipped faces, Surprinsingly
  13. I haven't found a proper way to avoid this yet. The part itself isn't reflected, thanks to the backculling, but all attached parts are. The culling mask for the probe can be set to ignore them, but then most elements of the scene are not reflected. The solution until I can get something to work is to set the "near clip plane" value pretty high. The RPSize values did nothing in 0.022, but it found a purpose again. It uses to be very small when I ran some tests with a probe per part (I wanted the probe to contain only the part's meshrenderer). Now it needs to cover the whole vessel (50
  14. DDS4KSP try to detect if a texture is a normalmap, it might be wrong sometimes. check the log file to see if your main texture has been converted correctly. If not, use the option to convert a single file and uncheck "Flag as normal".
  15. Yep. The R channel is not really broken in specular shaders, They use the StandardSpecular lighting model, where the Metal value isn't needed. http://docs.unity3d.com/Manual/SL-SurfaceShaders.html I kept their appearence order, but I can change it, or even separate these three values in their own textures (with 32 bits precision, this time), if needed. Maybe not a single shader for everything, but I can definitely reduce their count. I can do that for stock parts, but I'll let the specular shaders available, if someone want to use them. For coherenc
  • Create New...