Posted: 7th Feb 2021 2:26
Anyone know how I can achieve the cavity effect in blender in agk, models look flat and bland its horrible, does the shader pack have something to do this?

Blender


AppGameKit


Anything even remotely close?
Posted: 7th Feb 2021 3:30
1) What is your output format?
2) Are you baking the textures?
Posted: 7th Feb 2021 19:23
1., .Obj

2. No, I am using a colour pallet

EdgeDetection with Outline gives some interesting results


what I want is EdgeDetection with an alpha fadeoff so the lines gently highlight the edges and not neon sign them

its almost there, just to bold


Setting the alpha in SP_EdgeDetection_SetColor does not seem to do much.
Posted: 7th Feb 2021 20:18
I think if you unsmoothed you model it would look better
Posted: 8th Feb 2021 8:10
Try to split the model to faces
Posted: 8th Feb 2021 11:30
Creating a fade-off of the outline would improve things but you would also need to ignore the indices that are not a direct edge (the diagonals between vertices).
That would solve the 'ridge' part of the cavity shader. You still need the 'valley' part.

This is info only, I don't actually know how to do it. It's something I have asked elsewhere on the interwebs without result.
Posted: 8th Feb 2021 17:59
Looks like ur using vertex colors to be honest. Vert color will always be flat and dull. u need a diffuse layer for for lights. To interact with the model. Also light period other then ambient is important to have. If all surfaces are lit equally. Even I real life it would make depth and geometry hard to distinguish if not impossible. Also shade faces flat. you can shade one or more faces smooth but when you get to an edge that you want to be prominent make sure that edge has an extra edge on both sides. Very close or split the edge. That model definitely has smooth shading on it.
Posted: 8th Feb 2021 19:58
Looks like ur using vertex colors to be honest. Vert color will always be flat and dull.


No I'd expect vertex colors to to look flat and bland, I used a image pallet of gradient color to try to give some depth.

This is info only, I don't actually know how to do it. It's something I have asked elsewhere on the interwebs without result.


Maybe I need to learn Python and go route around the blender source to see how its done! lol

Thanks for the suggestions guys, some things to try here, I have noticed that the edge shader with really simple geometry actually works pretty well, it had a nice cartoon look and I think I can live with that

I am just trying to find an art style I can live with, looks good enough for prime time, can be reused across my games and protos, consistency in the assets market is a rare thing so if I want any then I better make my own.
Posted: 8th Feb 2021 20:19
The harsh dark color you get at the edges is because AppGameKit is trying to smooth your model around corners.
Thats why george and i have suggested you unsmooth or unweld the faces on your model

Posted: 9th Feb 2021 14:15
I found this:
Blender Cavity Shader
It looks promising it you can convert it.
Posted: 9th Feb 2021 17:08
Thats why george and i have suggested you unsmooth or unweld the faces on your model


That does add some definition for sure

It looks promising it you can convert it.


That looks perfect, from the blender source to, I knew it had to be out there somewhere lol

Only problem is I would not know where to start getting this to work in AppGameKit, I'll have a play around and see how many times I can break it before I give up! lol
Posted: 9th Feb 2021 21:18
Can't you apply your cavity effect in blender and then bake that to a texture?
Posted: 9th Feb 2021 23:41
Na, you bake what the camera sees, cavity is a view port only setting and no way to bake it that I can find, besides that would defeat the point of the single image pallet and low poly look I am after

I think I have found a happy medium for now, I did not want to go the Voxel route but as I am discovering that the shader packs edge detection likes simple meshes and I am practically using primitives in blender and Magica edge detection shader looks very much the same..... bottom line is what I see in the modelling app I get in the game engine which is good enough for me

I kinda like the low poly cartoon look, it would be nice to get that cavity shader working in AppGameKit but in lou of that I'll settle with this
Posted: 10th Feb 2021 8:52
I'm a big fan of that look too. I got in to it after watching Imphenzia video's on YouTube.
If you have a working shader now would you be willing to share it?
Posted: 10th Feb 2021 19:49
I cant, its from the shader pack DLC, Edge Detection, it does the job and I was happy until I found THIS ONE!, its got the edge fade thing and AO and looks fantastic even better than what I originally wanted, there would certainly be a steak and a few beers init for anyone that could make it run in AppGameKit lol

Edit:

I got in to it after watching Imphenzia video's on YouTube.


Yeah me to, great learning resource for blender but his style just works in Unity out of the box his stuff looks great and no shaders or faff, Godot the same but not as nice but at least it attempts to set some materials, AppGameKit is like no, you goner work for this!
Posted: 10th Feb 2021 22:38
I would say that "voxel" is the key word in that shader and it would be very good at drawing outlines around boxes.
This looked like it might do the trick



This is interesting. I think it pretty much gives you what you want.
I have taken a model and smoothed it at 15 degree angles and used that to break out the edges (I'm 100% sure you can easily do this with blender)
Then i extruded along normals (maybe rails in blender). I broke out the extrusion and saved that as a separete mesh.

I loaded the base model and then loaded and fixed the outline model to the base

I think it gives you much greater control over the outline (You could add glow and all kinds of effecs) and it is proportionate to the distance to camera.
Anyway. I'm pretty sure this would be easy to do in blender

Posted: 13th Feb 2021 9:26
some great models im seeing here

thought ide have a go at a flat shading shader not seeing much different so on my todo list atleast it dont error
vs
+ Code Snippet
in vec3 vPosition;
in vec3 vNormal;

attribute highp vec3 position;
attribute mediump vec3 normal;

uniform highp mat3 agk_WorldNormal;
uniform highp mat4 agk_World;
uniform highp mat4 agk_ViewProj;

varying vec4 fColor;
varying vec3 viewPosition;

uniform mat4 mvp;
uniform vec3 aColor;
uniform vec3 lDirection;
uniform vec3 lColor;

void main()
{
    gl_Position = mvp * vec4(vPosition, 1);

    vec4 ambient = vec4(aColor, 1);
    vec4 diffuse = vec4(max(dot(lDirection, -vNormal), 0.0) * lColor, 1);

    fColor = ambient + diffuse;
	highp vec4 pos = agk_World * vec4(position,1.0);
    mediump vec3 norm = normalize(agk_WorldNormal * normal);
    gl_Position = agk_ViewProj * gl_Position;
}

ps
+ Code Snippet
varying vec4 fColor;
varying vec3 viewPosition;

uniform vec3 aColor;
uniform vec3 lDirection;
uniform vec3 lColor;

void main()
{
    gl_FragColor = fColor;
}
Posted: 14th Feb 2021 0:07
I use that shader on my model and it shows nothing. blank screen
Posted: 14th Feb 2021 5:06
I use that shader on my model and it shows nothing. blank screen


Same here.

This is interesting. I think it pretty much gives you what you want.


Pretty neat, I'll give that a try
Posted: 14th Feb 2021 18:14
@blink0k very nice ship you have there, like that very much.