I worked on a basic scene in the playground, and tried to replicate it in a React Native project. Here’s the PG: https://playground.babylonjs.com/#20OAV9#14149
Problem 1:
In React Native, the cube is rendered and the directional light applied to its faces, but it does not cast a shadow on the floor. I checked the shadowGenerator.getShadowMap().renderList and meshes were pushed. Any ideas what I can try?
Problem 2:
Even in the web playground, if I uncomment line 27, cube.receiveShadows = true
I get some artifacts in the cube’s material. Is it something wrong with how I set up the frustrum?
I’ve added the light gizmo to help understand what’s wrong but I don’t see the issue…
Any help appreciated.
Edit: adding my package.json for reference
{
"name": "BabylonJSTestProject",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@babylonjs/core": "^6.49.0",
"@babylonjs/loaders": "^7.3.1",
"@babylonjs/react-native": "^1.8.2",
"@babylonjs/react-native-iosandroid-0-71": "^1.8.2",
"@types/geojson": "^7946.0.14",
"react": "18.2.0",
"react-native": "0.73.7"
},
"overrides": {
"@babylonjs/core": "^6.49.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}