@John@Simeon - filling out a crash report and touched the screen outside the report panel and it disappeared. So, here is what I was doing - I loaded a demo from @binaryblues at this link
First demo on topic.
I was trying different models in it and whilst trying to zoom the scene it crashed.
Couple of points
On the demo the scene was red coloured and I couldn’t change it to natural light, didn’t seem in line with the colours displayed.
Secondly, I have tried to add a skybox in the background() command but I don’t know the syntax - can you give us a hint.
Cheers
Edit: @John, I may be wrong but I think the red colours in the objects for the above demo is the default texture colour.
Adding a cube image path to background() merely got me a black background.
@Bri_G You can comment this line as a temporary tip:
scn.sky = nil
then the red back light will disappear.
About the crash, I have a guess: the animation models need more memory. The more models we load, the more likely we are to crash due to insufficient memory. Please try to comment three models, and only keep one.
@binaryblues - thanks for that, worked a treat and the skybox became visible. Only problem with the skybox now appears to be size. The image looks to be zoomed in. Is there a scaling factor for it?
@binaryblues - hmmmmm, tried several sized skybox images and all seemed to show very similar images. Not sure on the syntax for the skybox in V4. I’ve been trying to add it in the background() function, as described in the docs, but with little success.
What sized images have you used?
Edit: slowly getting there now, found an example in the docs which uses a shader. Set up a model in it and it partially displays the skybox but elements above and below are not complete.
@binaryblues - thanks again for the post, tried it with my image and had the same effect. Tried to attach an image to show that the image is not wrapping. Image size was 2048 x 1536. Reduced it to 1024 x 768 and still same effect. What dimensions did you succeed with ?
@John - am I missing something here, your demo with the forest scene seems to be OK ?
Edit: Found my answer - @ John has used an interpolation of a solid image, not the cross shaped images used for V3, the skybox images that we are used to. The Norway Forest image does seem to be distorted a little almost like a fish-eye lens so we may have to modify a standard image before use. The forest image is 2048 x 1024.
Use following code to see it (in V3) :
function setup()
--
pic = readImage(asset.builtin.hdr.Norway_Forest)
print(spriteSize(pic))
end
function draw()
--
background(0)
sprite(pic,WIDTH/2,HEIGHT/2)
end
Edit 2: As I thought, grabbed recent space telescoped image and used that in the code you posted and it gives a complete skybox effect but where the edges meet show contrasting edge effects. Seem to remember this in V3 until @John modified it.
Yes, as you’ve noticed, V4 handles background images differently. In Craft we supported both cube-maps and HDRIs (equirectangular images). We need to explictly add support for detecting and loading t-shape cubemap images for them to display correctly in these situations
@John - thanks for the reply. Didn’t realise V3 could handle different types of textures in skyboxes. I’m intrigued about how you can create a texture, like the forest one, which wraps without edges. When you look at that image around the edges it does look like the image has been manipulated. What’s the technique ? Are there any references for it ?
A HDRI is a panoramic (360 degree) seamless image of an environment with a high dynamic range (pixel values go beyond 0-255). This is useful for more than just backgrounds because it can also be used as a source of indirect environmental lighting (see - image based lighting)
Here’s a video of how to make one with just your phone:
As long as it is a normal HDR image, it should be fine. John offers the general way to make HDR images, and there are free resources available on the web to download:
@John@binaryblues - thanks for the feedback on HDRi, did a little digging myself since the original post and found a Wikipedia page and lots of images on the net. Incorporated a couple into a Codes project. The video on make your own with your phone was interesting. Must try that.
Thanks again, will keep me busy for a while.