Closed Eisenspalter closed 5 months ago
Hi @Eisenspalter, To create a sphere skybox you need to use shader type spatial because our sphere is a 3D object, then you can simply apply panaromic texture just make sure to set cull mode to front You don't necessarily have to use the add-on as well.
That is not so easy. That only works, if you stand in the middle of the sphere and you don't move. If you want to use it like a real SkyBox you need a shader with an Equirectangular Projection.
Hi @Eisenspalter, I have a question, why create a skybox on sphere? Any specific reasons?
For a SciFi game: Each sphere is a world and you move/fly from one to another then you shrink down and play the level. I also will use this it for an art exhibition where each artist has his own sphere and you walk from one to another to watch the paintings. Both are VR projects. In Unity I have the shader to do this. I tried to port it to Godot but something doesn't work. vec3 viewDirection = CAMERA_DIRECTION_WORLD; vec2 equiUV = (vec2( (atan( viewDirection.x , viewDirection.z ) / TAU ), (1.0 + ( ( asin( viewDirection.y ) / ( HALF_PI ) ) - -1.0) * (0.0 - 1.0) / (1.0 - -1.0)) )); ALBEDO = texture(skyBoxi, equiUV).xyz;
This is the shader I created in Godot. But It doesn't work
This is the Unity (Amplify) Shader that works and I tried to recreate
I don't know much about Amplify but could you tell me what would be in "viewDirectionRotated"? Just a View direction of a fragment in world space? By knowing that I think I could solve this.
These are optional animation parameters to rotate the skybox. But I have now used VIEW instead of CAMERA_DIRECTION_WORLD. Now things look much better. Now the only thing that seems to be missing is the rotation of the HEAD/Camera/View. In addition, VIEW is only available in the fragment shader (worse performance).
Better image. This image looks better, and I hide some test items
I forget to say. The optional rotation was multiplied with the View Direction in World Space. That the reason I use the VIEW know in my viewDirection variable
I want to create a Skybox on a sphere based on a panorama sky texture. In Godot I can only use the shader type SKY for the default skybox. I cannot use for a custom sphere, so I have to write me own shader. I do a lot of research but I can't get any further. Can I use your Shader-Lib do create such a shader? I'm very desperate because I haven't made any progress for months.