Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
Is this using jPCT or jPCT-AE?
42
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.  :'(
43
Support / Texture Splatting with 4 textures but using 5 sampler2D uniform variables
« Last post by Lima on 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:
Code: [Select]
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:
Code: [Select]
vec3 result = a+b+c+d;to
Code: [Select]
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
Code: [Select]
Config.maxTextureLayers = 10;but no success, unfortunately.
44
Support / Re: 3D modeler app made with JPCT-AE, possible or not?
« Last post by EgonOlsen on July 10, 2023, 08:23:58 am »
Nah, not my cup of tea, I'm afraid.
45
Support / Re: 3D modeler app made with JPCT-AE, possible or not?
« Last post by MichaelJPCT on July 10, 2023, 04:06:33 am »
i might have a method to avoid uploading new mesh every time a vertex is moved or added or deleted etc. - using shader and dynamic uniforms.
would you be interested in making an app like this? you can sell it on google app store. i think it takes only a few months to finish the basic program. i think many people would like to use such an app , for casual modeling. and it's output file can be re-edited by other modeler softwares (3dsmax etc).
i might be able to make an app myself but it would be very limited and non-professional, since it's not my main goal, and i am not a professional programmer.
46
Support / Re: 3D modeler app made with JPCT-AE, possible or not?
« Last post by EgonOlsen on July 08, 2023, 11:20:22 am »
I don't really think so. You could do it, but it would mainly be hacking around some of the concepts in jPCT that exists because it's meant to be a 3d engine for displaying existing content, not for creating new one. For an editor, I would go more low level because you constantly have to update your vertex buffers and such.
47
Support / Re: 3D modeler app made with JPCT-AE, possible or not?
« Last post by MichaelJPCT on July 08, 2023, 09:38:02 am »
thanks for your confirmation.
i guess using jpct-ae, one can make a modeler app which is usable but limited in functionalities and lower performance and non-professional looking. tricks must be used to solve some problems. that way, the app's worth is a doubt.
at the meantime, how about windows version of jpct? a modeler made with jpct, designed for tap control (tablet PC), is this easier? is this kind of app worth the efforts?
48
Support / Re: 3D modeler app made with JPCT-AE, possible or not?
« Last post by EgonOlsen on July 08, 2023, 08:35:34 am »
I don't think that jPCT-AE is very well suited for this kind of application. It's made to render more or less static assets fast, not so much for updating them constantly. Also, it doesn't supports lines properly (mainly because GLES is limited in that regard).
49
Support / Re: using multiple renderers in 1 process?
« Last post by EgonOlsen on July 08, 2023, 08:33:18 am »
It depends, I guess. You can run software and hardware renderer in parallel if you are using distinct worlds and objects. You can also make the software renderer use all available cores. If that's faster or not highly depend on the application and if it's worth the hasle...I'm really not sure.
50
Support / 3D modeler app made with JPCT-AE, possible or not?
« Last post by MichaelJPCT on July 07, 2023, 01:52:27 pm »
i wish i could make 3D models on android devices, using tap control only. so that i dont need windows PC and mouse.
i wonder whether it's possible to make an app with basic modeling functionalities, like some of those in 3DSMAX.
one problem i anticipate is that, models are highly dynamic in a modeler app, i've never tried that with JPCT.
another problem is that, there are symbols, lines, translucent objects, etc.. i dont know whether GLES is good enough to handle all those elements.
anyone interested in such app or with technical insight?
Pages: 1 ... 3 4 [5] 6 7 ... 10