Git Product home page Git Product logo

Comments (12)

ShadowLordAlpha avatar ShadowLordAlpha commented on May 27, 2024

hm no it was me however it seems that not setting some or all of these values

Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2

in the mtl file breaks textures appearing. They should probably default to a value that allows a texture to apear when not set in the mtl file though again that could also be me.

from silenceengine.

sriharshachilakapati avatar sriharshachilakapati commented on May 27, 2024

There is no map_kd in the material file?

from silenceengine.

ShadowLordAlpha avatar ShadowLordAlpha commented on May 27, 2024

there is I left it out because it was already in the file the whole thing is

newmtl dirt
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd dirt.jpg

from silenceengine.

sriharshachilakapati avatar sriharshachilakapati commented on May 27, 2024

The ambient component Ka of the material is set to zero which means the object will not be visible when there is no light. This is the behaviour you get when rendering it in Blender, or whatever modelling tool you use.

from silenceengine.

ShadowLordAlpha avatar ShadowLordAlpha commented on May 27, 2024

The object would have shown up black then when it was showing up white as if there was to much light like the default is 1 1 1 not 0 0 0. Also there was light in the scene as I am using a modified version of obj test.

from silenceengine.

sriharshachilakapati avatar sriharshachilakapati commented on May 27, 2024

This is sounding like a bug, I'll work on this issue. And I'm browsing your code on the repository you pushed 13 hours ago, you are setting the light to white? So the shader is adding the light color I think, making everything look white. This is a shader issue probably. Will look at that as soon as possible.

from silenceengine.

ShadowLordAlpha avatar ShadowLordAlpha commented on May 27, 2024

ok im updateing the code now so that it produces the white terrain on Yirath (none of the extra material parts set other than texture)

from silenceengine.

sriharshachilakapati avatar sriharshachilakapati commented on May 27, 2024

And does the model has texture coordinates exported? Otherwise the model assumes the texture coordinate as zeroes, so the texture might be rendered gray or white.

from silenceengine.

ShadowLordAlpha avatar ShadowLordAlpha commented on May 27, 2024

no texture coordinates are correct (the exporter i use will only export a mtl file when it has a texture so it will also generate the proper coords) just adding this

Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2

between newmtl dirt and map_Kd dirt.jpg will fix it to display properly as well

EDIT:
in the terrain0.mtl file of course

from silenceengine.

sriharshachilakapati avatar sriharshachilakapati commented on May 27, 2024

Did it fix this issue? I'll have to re-implement the model class anyway to support animated models, so if this isn't fixed, I will look at this too. The shaders are looking correct to me. If you confirm that this is working, I will close this issue.

from silenceengine.

ShadowLordAlpha avatar ShadowLordAlpha commented on May 27, 2024

setting it directly does fix the problem however in the Material class your default for ambient is ambient = new Color(1, 1, 1, 1); when it should more likely be black or something like ambient = new Color(0.1f, 0.1f, 0.1f, 1);

from silenceengine.

sriharshachilakapati avatar sriharshachilakapati commented on May 27, 2024

I set the default ambient to white, because the Material is also applied to the 2D rendering, made through Batcher. The model changes the material, does the rendering, and switches back to the default material so that the GUI and other 2D graphics will render at full intensity. And, many models will set those values in their models, so there is no need to change that.

I'm now closing this issue, but you can still reply to it if you want to say something on this topic.

from silenceengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.