vaios
March 8, 2016, 1:04pm
2
You can use the shader chunks system. The PlayCanvas engine uses lots of little chunks of shader code that control various parts of the final rendered image. You can change those chunks and plug in your shader code and the rest of the built-in chunks will handle shadows.
Here are some examples:
I have a fairly simple shader that I’ve written, but I want it to have all the lighting/specular, etc
The shader I’ve written takes a mask with using the Red and Blue channels to replace the red with another texture and the blue with 1 colour and the rest is a 2nd colour, which is done like:
void main(void)
{
vec4 maskTex = texture2D(mask, TexCoordOut);
vec4 faceImageTex = texture2D(faceImage, TexCoordOut);
vec4 ballColor = vec4(ballcolour_r, ballcolour_g, ballcolour_b, 1);
…
Hello,
Is there a way to access the 3d entity that is used to render the cubemap for the skybox? So I can apply a fragment shader.
I would like to apply a hue/saturation effect to the skybox textures.
Any suggestions?
Best regards,
Leonidas
Continuing the discussion from FBX import issue? :
There is a simple example of Toon Shading here using the technique @max describes of duplicating the model.
1 Like