Main Menu

Recent posts

#81
Projects / Re: my project - Vehicle Simul...
Last post by MichaelJPCT - August 10, 2023, 05:47:36 PM
Thanks.
about the controls, you need to spend some time in the QUICK START and USER CONTROL chapters in the User Manual, just pay attention to the phase TOUCH UI.
or, if you have some teenager kids, let them read the User Manual and learn to fly, they can show it to you soon.
#82
Projects / Re: my project - Vehicle Simul...
Last post by EgonOlsen - August 10, 2023, 11:34:51 AM
This is an impressive piece of work. I've no idea how to control my plane and I crashed it into the ground, but it's cool nonetheless.
#83
Projects / Re: my project - Vehicle Simul...
Last post by MichaelJPCT - August 09, 2023, 06:13:02 PM
hello everyone,
i released a new demo . one main difference is that , this version has on-screen touch controls, no need for keyboard (but keyboard still works). just find the new file named 2023 08 in the link posted above, if you want to try it.
#84
Support / Re: Texture Splatting with 4 t...
Last post by EgonOlsen - July 20, 2023, 08:11:11 PM
Yeah, I think AeroShark333 is right about this. I couldn't find the corresponding thread (if there is any), but I dimly remember that I did something in that regard. Check the max value in TextureInfo and the log output. Somewhere, there should be an output about texture units...
#85
Support / Re: Texture Splatting with 4 t...
Last post by Lima - July 20, 2023, 12:20:12 AM
Thank you, guys! I think that's it. I'll rewrite the shader and use only jpct-ae from now on.
#86
Support / Re: Texture Splatting with 4 t...
Last post by AeroShark333 - July 19, 2023, 08:18:28 PM
Quote from: Lima on July 19, 2023, 02:14:49 AM
I'm very sorry! The information was clear in the docs. I really don't know why I didn't understand it when I read it at first. TextureInfo objects can only receive 4 images. It just ignores the rest if you add more.  :'(

I think jPCT-AE supports more than 4 texture units (up to 8 max.) due to the suggestion I made last year or two years ago. ;)
I'm not sure about jPCT (PC) version, however... Might still be limited to 4 there

EDIT: https://www.jpct.net/forum2/index.php/topic,5153.0.html
#87
Support / Re: Texture Splatting with 4 t...
Last post by Lima - July 19, 2023, 12:13:52 PM
I was using JPCT, but just for quick tests. I intend to use jpct-ae in the end.
#88
Support / Re: Texture Splatting with 4 t...
Last post by EgonOlsen - July 19, 2023, 10:50:41 AM
Is this using jPCT or jPCT-AE?
#89
Support / Re: Texture Splatting with 4 t...
Last post by Lima - July 19, 2023, 02:14:49 AM
I'm very sorry! The information was clear in the docs. I really don't know why I didn't understand it when I read it at first. TextureInfo objects can only receive 4 images. It just ignores the rest if you add more.  :'(
#90
Support / Texture Splatting with 4 textu...
Last post by Lima - July 19, 2023, 12:33:42 AM
Hello!
I'm trying to reproduce something I did using blender nodes. I have 5 textures, but one of them is a map. I use its RGBA channels as the factors to mix the textures with black and then, finally add them up.

This is my Fragment Shader:
varying vec2 texCoord;

uniform sampler2D textureUnit0;
uniform sampler2D textureUnit1;
uniform sampler2D textureUnit2;
uniform sampler2D textureUnit3;
uniform sampler2D textureUnit4;


const vec3 BLACK = vec3(0.0,0.0,0.0);
const vec3 YELLOW = vec3(0.5,0.5,0.0);

void main (){

vec2 newTexCoords = texCoord * 20.0;

vec4 map = texture2D(textureUnit0, texCoord);
vec4 asphalt = texture2D(textureUnit1, newTexCoords);
vec4 grass = texture2D(textureUnit2, newTexCoords);
vec4 ground = texture2D(textureUnit3, newTexCoords);
vec4 wall = texture2D(textureUnit4, newTexCoords);

vec3 a = mix(BLACK, asphalt.rgb, map.r);
vec3 b = mix(BLACK, grass.rgb, map.g);
vec3 c = mix(BLACK, ground.rgb, map.b);
vec3 d = mix(BLACK, wall.rgb, map.a);

        vec3 result = a+b+c+d;


gl_FragColor = vec4(result,1.0);
}

This is the result:
https://drive.google.com/file/d/1DHwsnlmv_Htm43qofuhufOIMA8vHlSWv/view?usp=drive_link

Just by changing the line:
vec3 result = a+b+c+d;
to
vec3 result = a+b+c+mix(BLACK, YELLOW, map.a);

I almost got what I want:
https://drive.google.com/file/d/1Bqms-MgMFlo6VSv2Ualm0A6MSS4Qdshn/view?usp=drive_link
But in this case I'm not really using my 4 textures, just 3 and a color created inside the shader.

The problem seems to be in textureUnit4 I think it's not being passed to the shader and thus, it results in a black color, which makes no difference in the final sum. How many textures can I add to a TextureInfo object? If the maximum is 4, then, that must be the reason why my fifth sampler2D uniform is ignored.

p.s. I even wrote this before initalizing my FrameBuffer
Config.maxTextureLayers = 10;
but no success, unfortunately.