Tag Info

New answers tagged


I'm not sure, but you probably should move code that sets color of light to update frame. As I understand you initialize light color only once at start of program, but it needs to be updated each frame, in accordance with this question.


The normals facing away from the camera are shaded black in your setup. Add more lights into the scene that are shining on parts you want lit up, or set up the lighting with a brighter minimum brightness.


This should be a comment but I cant make them :(. Anyhow it looks like a normals problem with your model. If you look at the bottom flower in the first picture the lighting is wrong and it looks like the light is coming from behind and above the flower instead of in front it. Try to set the color of each pixel to the value of normal to see if the normals ...


One way of doing this is to when you are loading the model and creating the vertex layout. you could calculate a second set of normals. which would be the flat normals. Do so by taking the connecting triangles. and then put it into all the vertices. if there is more than one connecting pollygon, you could insert some indexing to make it easier to handle ...


You need two different models, because flat-shaded and smooth-shaded models normals are different. One of the ways is to generate 2 separate models and replace them with one another on demand. Another way is to make a single model prepared for flat shaded render (all vertices unique) and replace only normals when switching to flat/smooth shading. For ...


When rendering to the screen you can simply not include the geometry to make the walls thick.

Top 50 recent answers are included