Git Product home page Git Product logo

Comments (14)

BennyQBD avatar BennyQBD commented on June 14, 2024

Could you please specify the following:
-What, specifically, is occurring? (i.e. What pointlights are currently doing to the plane mesh)
-What, specifically, did you expect to happen instead? (i.e. What are pointlights doing to the pyramid that they aren't doing to the plane)
-A detailed step by step process to reproduce the issue

Thanks!

from 3dgameengine.

erikverstegen avatar erikverstegen commented on June 14, 2024
  • I can't see the pointlights at all on the plane while I can see them perfectly on the pyramid mesh
  • I expect to see the pointlights apply their light to the plane (which they don't right now)
  • When you uncomment the first vertex and int array (the pyramid mesh) and comment the second vertex and int array (the plane mesh) you'll see the pointlights, but when you comment the pyramid mesh again and uncomment the plane mesh you can't see the pointlights.

from 3dgameengine.

 avatar commented on June 14, 2024

I had the same problem.
You should try to:

  1. try to calc the normals by hand

from 3dgameengine.

erikverstegen avatar erikverstegen commented on June 14, 2024

Well, I thought it had something to do with the normals, so I downloaded Benny's code and looked at the calculated normals (by printing it using .toString()) which matched up with my normals. I don't think it has something to do with that.

from 3dgameengine.

 avatar commented on June 14, 2024

ups..

  1. it fixed it for me to turn of cull facing.

In the end this was the Problem and solution:
the calc normals method from benny adds all normals on one vertex just together. But if you do that on a plane you just end up with a 0- Vector -> no direction is up -> no light at all is reflected.

To solve this problem I implemented a check if the angle between the two normals is too big.
If it is i add a new Vertex vith ist own normal and change the index of the triangle.

I have re-written bennys method but I have not tested it jet.

Hope I could help.

from 3dgameengine.

 avatar commented on June 14, 2024

Is the Plane just dark or is it bright but not light by the pointlight?

from 3dgameengine.

erikverstegen avatar erikverstegen commented on June 14, 2024

It's dark, but I can't see the pointlight on it.

from 3dgameengine.

 avatar commented on June 14, 2024

in wich class do you test it? i just downloaded the engine...

from 3dgameengine.

 avatar commented on June 14, 2024

and its not the source code. You uploaded the compiled files...

from 3dgameengine.

erikverstegen avatar erikverstegen commented on June 14, 2024

How about this one? http://ikbenerik.nl/Engine2.rar
I tested it in the Mesh class.

from 3dgameengine.

 avatar commented on June 14, 2024

sorry i cannot find any mistake in your code at the moment.
I will look at it later again. :)

from 3dgameengine.

BennyQBD avatar BennyQBD commented on June 14, 2024

Here's something that's stood out to me:
In your phong vertex shader, you're calculating the worldPosition from the vertex normal rather than the vertex position. I don't know if that's your issue, but it probably isn't what you intended to do.

from 3dgameengine.

erikverstegen avatar erikverstegen commented on June 14, 2024

Thanks Benny, that actually fixed it!

from 3dgameengine.

BennyQBD avatar BennyQBD commented on June 14, 2024

In that case, issue closed :)

from 3dgameengine.

Related Issues (18)

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.