Comments (12)
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.
There is no map_kd in the material file?
from silenceengine.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Wav file playing incorrect in desktop backend HOT 1
- Use DrawElement with a IntBuffer (transformed in ByteBuffer) for Indexes of element HOT 3
- Streams support HOT 3
- AMD shouts on Pre GL3 shaders in Core profile HOT 1
- Implement model loading API HOT 1
- Issue with parsing APK HOT 13
- Re-Evaluate iOS support HOT 2
- A reasonable way to handle files loading HOT 6
- Modularity for non essential features HOT 3
- Source and Javadocs not available HOT 1
- There are any screen of the game editor? HOT 2
- Add error callbacks to all asynchronous methods
- Fix performance issue on DynamicTree2D and DynamicTree3D HOT 1
- Add a dialog system for modal dialogs `prompt`, `alert` and `confirm` in the JS style. HOT 1
- Implement a `FileWriter` for writing to files on Android and LWJGL backends
- Android backend crashes on relaunch
- Implement Preferences API for persistent storage of Key-Value pair objects.
- Creating polygon convex hull from image HOT 1
- Clean SceneGraph and Entity Component API
- Forum is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silenceengine.