after a game require it and a lot of time to search, finally i found some source and here is some of my work about dynamic light. it’s old but still work and easy to use.
it’s fix version of avalon’s sample on github. here is how to use it.
finalShadowMapSprite->setColor({ 255, 255, 255 }) in DynamicLight.cpp
it should be replaced by finalShadowMapSprite->setColor({ color.r, color.g, color.b })
cocos2d: fullPathForFilename: No file found at shaders/pass.vsh. Possible missing file.
cocos2d: fullPathForFilename: No file found at shaders/pass.vsh. Possible missing file.
Get data from file(shaders/pass.vsh) failed, error code is 3
cocos2d: fullPathForFilename: No file found at shaders/shadowMap.fsh. Possible missing file.
cocos2d: fullPathForFilename: No file found at shaders/shadowMap.fsh. Possible missing file.
Get data from file(shaders/shadowMap.fsh) failed, error code is 3
OpenGL error 0x0502 in ..\renderer\CCGLProgram.cpp cocos2d::GLProgram::initWithByteArrays 182
Error linking shader program: 'Vertex shader(s) failed to link, fragment shader(s) failed to link.
ERROR: error(#280) Not all shaders have valid object code
ERROR: error(#280) Not all shaders have valid object code
'
Error linking shader program: 'Vertex shader(s) failed to link, fragment shader(s) failed to link.
ERROR: error(#280) Not all shaders have valid object code
ERROR: error(#280) Not all shaders have valid object code
'
cocos2d: fullPathForFilename: No file found at shaders/pass.vsh. Possible missing file.
cocos2d: fullPathForFilename: No file found at shaders/pass.vsh. Possible missing file.
Get data from file(shaders/pass.vsh) failed, error code is 3
cocos2d: fullPathForFilename: No file found at shaders/shadowRender.fsh. Possible missing file.
cocos2d: fullPathForFilename: No file found at shaders/shadowRender.fsh. Possible missing file.
Get data from file(shaders/shadowRender.fsh) failed, error code is 3
OpenGL error 0x0502 in ..\renderer\CCGLProgram.cpp cocos2d::GLProgram::initWithByteArrays 182
Error linking shader program: 'Vertex shader(s) failed to link, fragment shader(s) failed to link.
ERROR: error(#280) Not all shaders have valid object code
ERROR: error(#280) Not all shaders have valid object code
'
Error linking shader program: 'Vertex shader(s) failed to link, fragment shader(s) failed to link.
ERROR: error(#280) Not all shaders have valid object code
ERROR: error(#280) Not all shaders have valid object code
'
OpenGL error 0x0502 in ..\renderer\CCTexture2D.cpp cocos2d::Texture2D::initWithMipmaps 640
'Pods To Riches.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mciwave.dll'. Symbols loaded.
The thread 0x698 has exited with code 0 (0x0).
'Pods To Riches.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\mciwave.dll'
cocos2d: warning: Uniform not found: resolution
cocos2d: warning: Uniform not found: upScale
cocos2d: warning: Uniform not found: accuracy
cocos2d: warning: Uniform not found: resolution
cocos2d: warning: Uniform not found: softShadows
cocos2d: warning: Uniform not found: u_texture
cocos2d: warning: Uniform not found: u_texture
cocos2d: warning: Uniform not found: u_texture2
OpenGL error 0x0502 in ..\renderer\CCTextureAtlas.cpp cocos2d::TextureAtlas::drawNumberOfQuads 689
if you mean your basic Projectile is a lighter
ShadowCasters is all struct that receice light and cast shadows ( and isn’t basicProjectile )
and dylight is just a point light ( if same post with shadowncaster mean it’s inside so there is no shadow )