Comments (8)
Yes, that is the discrepancy I'm referring to. Small correction: it is
GetComponentCount()
that returns thesize
, notShaderDataTypeToOpenGLBaseType
.
Fixed my typo, thanks
I don't think we would ever even need to send a mat3 or mat4 as vertex buffer attribute.
It's about correctness... If we wouldn't support it, then we wouldn't add it in the first place...
from hazel.
I don't see anything wrong, can you clarify what's wrong about that piece of code?
from hazel.
As I'm reading this, these lines will return a component count of 9 and 12 respectivly, which, i think is correct?
Hazel/Hazel/src/Hazel/Renderer/Buffer.h
Lines 54 to 55 in 3c14780
But as the OpenGL specification says for the second parameter:
size
:
Specifies the number of components per generic vertex attribute. Must be 1, 2, 3, 4. Additionally, the symbolic constant GL_BGRA is accepted by glVertexAttribPointer. The initial value is 4.
Meaning the return value of the GetComponentCount
function (as shown above) will result in an error as it returns a value that is higher than 4? Which in that case would result in an error:
GL_INVALID_VALUE
:
Generated if size is not 1, 2, 3, 4 or (for glVertexAttribPointer), GL_BGRA.
As I am not sure, my intuition says it is correct, but the documentation clearly states it's not...
from hazel.
Yes, that is the discrepancy I'm referring to. Small correction: it is GetComponentCount()
that returns the size
, not ShaderDataTypeToOpenGLBaseType
.
from hazel.
I don't think we would ever even need to send a mat3 or mat4 as vertex buffer attribute.
from hazel.
Also, bool can't be a vertex buffer attribute
from hazel.
I would like to point out this information from the OpenGL specification.
I would also like to point out that Buffer.h
is part of our RendererAPI independent code and it might be standard in other APIs to provide the full size (I don't know other APIs so I can't say for sure). In that case this can stay as is and should be handled as a special case on the OpenGL side of the code.
Either way there should probably be specific code on the OpenGL side to handle the case for matrices properly.
from hazel.
I would like to point out this information from the OpenGL specification.
I would also like to point out that
Buffer.h
is part of our RendererAPI independent code and it might be standard in other APIs to provide the full size (I don't know other APIs so I can't say for sure). In that case this can stay as is and should be handled as a special case on the OpenGL side of the code.Either way there should probably be specific code on the OpenGL side to handle the case for matrices properly.
Yes, the function itself is correct, but it is still an error that OpenGL is using this. So it is still a valid issue, we just need an OpenGL solution for this
from hazel.
Related Issues (20)
- Redundant two lines of code to set io.DisplaySize in ImGuiLayer.cpp
- Error on the first compiling of Hazel.sln HOT 1
- Error: cannot open Hazel/vendor/Box2D: No such file or directory HOT 8
- Linking Error when compiling. HOT 4
- in Sandbox: ExampleLayer OnImGuiRender ImGui::Begin("test") trigger an error
- MacOS Support HOT 5
- Error during instalation "name 'solution_items' in use"
- Proper Rigid Body Physics engine
- I have added the transform component UI to my Engine and it's working good but there is a slight problem . HOT 1
- I have added the transform component UI to my Engine and it's working good but there is a slight problem which is the scale on the z axis doesn't work. why is that ? and how to fix it ? HOT 1
- 11 HOT 3
- The m_VulkanSPIRV and m_OpenGLSPIRV variables in OpenGLShader.cpp have no numerical values and remain empty, Why is it still used for assignment?
- Hello Everyone
- Hello Everyone. HOT 1
- Really Need Help ! HOT 1
- ShaderBinary problem HOT 4
- Problem when running Project on Intel GPUs HOT 7
- Transform Component Add Crash HOT 1
- error MSB3073: The command "IF EXIST ..\bin\Debug-windows-x86_64\Hazel\Hazel.dll\ (xcopy /Q /E /Y /I ..\bin\Debug-windows-x86_64\Hazel\Hazel.dll ..\bin\Debug-windows-x86_64\Sandbox > nul) ELSE (xcopy /Q /Y /I ..\bin\Debug-windows-x86_64\Hazel\Hazel.dll ..\bin\Debug-windows-x86_64\Sandbox > nul) HOT 2
- Error in ./scripts/Setup.py HOT 9
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 hazel.