Black noise on solid color texture

Anything libgdx related goes here!

Black noise on solid color texture

Postby Dudule » Sat Aug 24, 2019 3:25 pm

Hi everybody !
I'm trying to play with a 3D model. It was working well, but when I tried to put a image as texture on a part of the model, black noise appeared on other textures (solid colors). Does somebody know why ?
My texture picture is a 512x256 png.

In Screen.show
Code: Select all
        camera = new PerspectiveCamera(67,Gdx.app.getGraphics().getWidth(), Gdx.app.getGraphics().getHeight());
        camera.near = 1f;
        camera.far = 10f;
        camera.position.set(0f, 5f, 5f);
        camera.lookAt(0, 0, 0);
        camera.update();

        modelBatch = new ModelBatch();

        environment = new Environment();
        environment.set(new ColorAttribute(ColorAttribute.AmbientLight,new Color(0.8f, 0.8f, 0.8f, 1f) ) );
        DirectionalLight dLight = new DirectionalLight();
        Color lightColor = new Color(0.5f, 0.5f, 0.5f, 1f);
        Vector3 lightVector = new Vector3(0f, -1f, -1f);
        dLight.set(lightColor, lightVector );
        environment.add( dLight ) ;

        AssetManager assets = new AssetManager();
        assets.load("karts/kart.obj", Model.class);
        assets.finishLoading();

        Model model = assets.get("karts/kart.obj", Model.class);
        instance = new ModelInstance(model);
        instance.transform.setToScaling(0.01f,0.01f,0.01f);


In Screen.render
Code: Select all
        Gdx.gl20.glEnable(GL20.GL_BLEND);
        Gdx.gl20.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
        Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 0f);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT );

        camera.update();

        modelBatch.begin(camera);
        modelBatch.render(instance, environment);
        modelBatch.end();


Unfortunately, I can't upload a picture for attachment, I don't know why, I've got the message "Could not upload attachment to ./files/14204_e7ce254e144b44ece4db9ecff02aa89e"

Thank's a lot.

Christophe
Dudule
 
Posts: 18
Joined: Sun Aug 27, 2017 6:33 pm

Re: Black noise on solid color texture

Postby Dudule » Sat Aug 24, 2019 3:34 pm

Wel, my problem is larger :
When I use a 32x32 png orange picture, all my other textures are tinted in orange.
If I use a 32x32 png green picture, all my other textures are tinted in green. Etc...
Why my pictured texture interacts on other textures ?
Thank's

Christophe
Dudule
 
Posts: 18
Joined: Sun Aug 27, 2017 6:33 pm

Re: Black noise on solid color texture

Postby tomski » Sat Aug 24, 2019 4:20 pm

can you show screenshots? Use a service like imgur
tomski
 
Posts: 909
Joined: Wed Jun 26, 2013 6:06 pm

Re: Black noise on solid color texture

Postby Dudule » Sat Aug 24, 2019 4:38 pm

3 results here :

https://drive.google.com/open?id=1bBRmKVoAaZ39FTh3ck6-SdUET3QGXozw
https://drive.google.com/open?id=14aFeTtvJ8bW48aopVlnfl5Ea6pcrgOn-
https://drive.google.com/open?id=1qNRPoP2CIVAxd_dZdaIWKubgOHpbwbfe

The .mtl extract for the second test
Code: Select all
newmtl Matiere1
Ka 0.478431 0.478431 0.478431
Kd 0.478431 0.478431 0.478431
Ks 0.333 0.333 0.333
Ns 0
d 1
Tr 1
map_Kd kart_Textures/Matiere1.png
Dudule
 
Posts: 18
Joined: Sun Aug 27, 2017 6:33 pm

Re: Black noise on solid color texture

Postby tomski » Sat Aug 24, 2019 4:39 pm

What does your texture for that object look like?
tomski
 
Posts: 909
Joined: Wed Jun 26, 2013 6:06 pm

Re: Black noise on solid color texture

Postby Dudule » Sat Aug 24, 2019 4:45 pm

Dudule
 
Posts: 18
Joined: Sun Aug 27, 2017 6:33 pm

Re: Black noise on solid color texture

Postby Dudule » Sat Aug 24, 2019 5:37 pm

Dudule
 
Posts: 18
Joined: Sun Aug 27, 2017 6:33 pm

Re: Black noise on solid color texture

Postby Dudule » Tue Aug 27, 2019 1:58 pm

Hello, it seems there is a problem with the OBJexporter plugin under Sketchup. If I ungroup parts of the model, it's working fine. On some groups, there is a mix between color and one png texture of the model, but not for all the groups.
I don't know if the problem comes from libgdx or from the OBJexporter plugin.

Thank's a lot anyway.
Dudule
 
Posts: 18
Joined: Sun Aug 27, 2017 6:33 pm


Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest