Hey guys, I hope this is not just me. But it seems like the powers that be at PlayCanvas are purposely WITH HOLDING all the crucial documentation on how to do anything.
For example Shadows… EVERY PRINTED WORD on the internet that has ANYTHING to do with shadows and PlayCanvas (which is not much) say Just goto Editor and Check this box… Im sorry… BUT What kind of developer can just live with that… No explanation on what you need to really setup via code (WHICH YOU GUYS WHO MAKE THE EDITOR… HAVE TO HAVE DOCS FOR).
I mean its like saying: Dont worry your pretty little head about how things are getting done, you just pay us, use our ONLINE EDITOR ONLY (even if it does not fit with your workflow) and just be happy… What is that about ???
I get that you need to make money and want people to pay for your on-line editor. But what about us FOLKS who need to know how to get to the nitty gritty and setup things like Shadows, Skyboxes etc… I guess we are just OUT OF LUCK.
We all that being said… I am going to beg for help here on the forum. Because there is NO PRINTED WORDS ON THE ENTIRE PLANET (that i can find) that details all your need to do as a developer to get lights and shadows going (Beside of course… Just our Editor and dont worry about it)… Im just guessing here
i have castShadows and receive shadows checked on the Model Component
I am setting the light Component Up:
let lightOptions:any = {};
let lightOffset:number = 0;
let lightScale:number = 0;
let lightAngle:number = component.spotangle * component.conefactor;
let lightType:number = component.type.Key;
if (lightType === 0) { // SPOT_LIGHT
lightOptions.type = "spot";
lightScale = component.spotscale;
lightOffset = component.angleoffset;
} else if (lightType === 2) { // POINT_LIGHT
lightOptions.type = "point";
lightScale = component.pointscale;
lightOffset = 0;
} else { // DIRECTIONAL_LIGHT
lightOptions.type = "directional";
lightScale = component.directionalscale;
lightOffset = component.angleoffset;
}
// ..
// TODO: Setup light cookie texture options
// ..
lightOptions.color = CanvasTools.ParseColorProperty(component.color);
lightOptions.range = component.range;
lightOptions.intensity = component.intensity * lightScale;
lightOptions.innerConeAngle = lightAngle;
lightOptions.outerConeAngle = lightAngle + 5;
// Setup shadaw map generation options
let shadows:number = component.type_aux.Key;
lightOptions.castShadows = (shadows !== 0);
lightOptions.shadowBias = component.bias;
lightOptions.normalOffsetBias = component.normalbias;
let resolution:number = component.resolution.Key;
if (resolution === 1) { // LOW_RESOLUTION
lightOptions.shadowResolution = 512;
} else if (resolution === 2) { // MEDIUM_RESOLUTION
lightOptions.shadowResolution = 1024;
} else if (resolution === 3) { // HIGH_RESOLUTION
lightOptions.shadowResolution = 2048;
} else if (resolution === 4) { // VERY_HIGH_RESOLUTION
lightOptions.shadowResolution = 4096;
} else { // DEFAULT_RESOLUTION
lightOptions.shadowResolution = 1024;
}
entity.addComponent("light", lightOptions);
So light bias = 0.05 and normal bias = 0.5… But my shadow edges look like crap…
It also ssays somewhere that you can change the change type to use HARD or SOFT shadows…
BUT NOTHING on how to actually do so… What the heck do i set to enable hard or soft shadows…
I cant be the only one in world that feels this way… How is an indie developer ever supposed to really make a game with the PlayCanvas Engine…
OR ARE WE NOT SUPPOSED TO… JUST PAY, USE THE ONLINE EDITOR AND DONT WORRY YOUR PRETTY LITTLE HEAD ABOUT ACTUALLY LEARNING THE INS AND OUT OF THE ENGINE…
Example Shadows in Online Edit… Look GOOD
Example done from Engine only code… Like CRAPPY
P.S.
I am so sorry to be the A-HOLE that is bringing this up… But i dont know what else to do… where else to look for answers… Again sorry so negative