Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attributes out of range #30

Open
greggman opened this issue Feb 27, 2014 · 4 comments
Open

attributes out of range #30

greggman opened this issue Feb 27, 2014 · 4 comments

Comments

@greggman
Copy link

See this stackoverflow question

http://stackoverflow.com/questions/21018524/webgl-not-rendering-textures-on-some-devices/

Turbulenz appears to be using attributes out of range. For example checking Score Rush I see it uses attributes 0, 3, and 8. Why not 0, 1, 2? In any case, WebGL only requires 8 so on a device that only supports 8 attributes 7 is the highest numbered attribute that can be used which means Score Rush is going to fail when trying to use attribute 8.

@davidgaleano
Copy link
Contributor

The mapping from semantic to attribute index that we use is a traditional one. I think it originated when hardware was moving away from fixed-function pipelines to shader-based ones. You can find semantic mappings identical to ours in other places:

http://src.chromium.org/svn/trunk/o3d/core/cross/gl/utils_gl.cc
http://http.developer.nvidia.com/Cg/vp40.html

It is possible that it was something only particular to some video cards.

According to WebGL Stats, only 0.3% of users have less than 16 vertex attributes:

http://webglstats.com/

Perhaps we could reorder the semantics table only for those devices, moving the most esoteric semantics to higher indices...

Whilst we change our code, if you want to make your game work on those devices you could just use other semantics with lower indices, just make sure that both the shader and the vertex stream use the same one.

@pjuke
Copy link

pjuke commented Feb 27, 2014

Thank you greggman and David.
I have had a discussion with Ian previously about this @ the forum. https://groups.google.com/forum/#!topic/turbulenz-engine-users/d9qDsTrEACE. Glad you finally found out what was causing the issue.

I would really like to see this change being put into code, since I lack the knowledge to do it myself.

bmaltby pushed a commit that referenced this issue Mar 7, 2014
dtebbs pushed a commit that referenced this issue Mar 7, 2014
* master: (53 commits)
  Remap semantics/attribute indices when max supported is less than 16, should help with turbuenz_engine/#30.
  Unify semantics names on the ATTR form to match programs code.
  Added support for the latest version of the Gamepads specification.
  Keep original geometry data because physics will use it later on.
  Updated changelog to include tslint note.
  More tslint fixes.
  Fixed declaration of variable inputs.
  Fix check-ts launching tslint on windows
  Fixed tslint errors.
  Updated release notes and changelog for latest engine
  Updated copyright and tslint
  Updated AssetCache to version 2: - Improvements to performance. - Added new function 'get'. - Changed behaviour of 'request'. - Improved edge case handling.
  Fixed to run npm from the nodejs installed by turbulenz engine
  Added missing semicolons.
  Relax centre position check to be a tenth of the collision margin.
  Add .tslintrc for check_ts
  Add support for running tslint on typescript source with check_ts
  Fixed to use unsigned typed array.
  Pass extents information to convex hull creation.
  Pass existing extents information to convex hull creation.
  ...
@ianballantyne
Copy link

This issue should have been addressed now. Please can you try it out in the latest master.

@ianballantyne
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants