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

A fix to bug preventing to use textures in users shaders for derived class #2

Open
stephane2017hongkong opened this issue Jun 24, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@stephane2017hongkong
Copy link

stephane2017hongkong commented Jun 24, 2020

Hi,

In SampleScene example, the shaders are not using textures.
In the code I wrote, I do use a texture.
It causes a problem because of unspecified use of texture.
A fix is , within the HoloPlayContext.cpp, to specify a texture to use

Here is a work around that worked for me :
Replace

// 8. now render on view texture
glBindVertexArray(viewTex);

by

glActiveTexture(GL_TEXTURE0)
glBindTexture(GL_TEXTURE_2D, self.viewTexture)

Then in the derived class from HoloPlayContext, specifiy

glActiveTexture(GL_TEXTURE1)

Allows to have the result compiling and display nicely on the LookingGlass.

I hope it helps.

@alxdncn alxdncn added the enhancement New feature or request label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants