Git Product home page Git Product logo

Comments (3)

BennyQBD avatar BennyQBD commented on June 14, 2024

Does the current version of the repository work for you?

To answer your other questions:
-I believe that was true at one point, however, as far as I'm aware it isn't true in older GLSL versions, and it also isn't true in newer GLSL versions. As OpenGL wiki says in https://www.opengl.org/wiki/Core_Language_%28GLSL%29 , "The default if no qualifier is specific is in." That, combined with the fact that it works with every GLSL compiler I've ever seen, seems to indicate that this is perfectly legal code.

-In a way that stays compatible with GLSL 120, no. However, if you don't care about that, GLSL offers a textureSize function ( https://www.opengl.org/sdk/docs/man/html/textureSize.xhtml ). You can use that to find what the texture's size is, and based on that, you can determine if a texture is bound or not.

from 3dgameengine.

ypiadyk avatar ypiadyk commented on June 14, 2024

Hello, Benny.
Sorry for the late reply. I was following your tutorials further and we get rid of this "weird if statement" later in series when implementing forward rendering system. But it wasn't problem in if statement. Using gDEBugger I have discovered another weird thing that really happens:

  • On engine side all uniforms are updated with correct values (doublechecked with debugger, uniform locations are all different). But on shader side pointLight.base.intensity and pointlight.atten.constant uniforms behave like it's one uniform. More precisely pointLight.base.intensity is always equal to pointlight.atten.constant for some mysterious reason. Hence I can't set pointLight.base.intensity to desired value.

This may be connected to another problem I posted: BennyQBD/3DEngineCpp#22
This time pointLight.base.intensity and several more uniforms are optimized away.
And another fact: R_directionalLight.base.intensity works fine.
Did you see such issue earlier? And thanks for answers for other questions!

from 3dgameengine.

BennyQBD avatar BennyQBD commented on June 14, 2024

One quirk of GLSL is if the GLSL compiler doesn't think a uniform affects the code, then it silently removes it. It's possible that one of those two uniforms, according to the GLSL compiler "doesn't affect the code," and that the removal has given them the same value in the final output. I suspect that this could be a driver bug, and if the code works on other computers, then it probably is.

That's one of the reasons why I want to know if the current repository works for you. If it doesn't, then it almost certainly is a driver issue (or I've somehow royally screwed something up somewhere). If it does work for you, then it's more likely that you've either made a mistake in your GLSL code, or you've written your GLSL code in a way that's confusing the compiler like that.

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.