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

const float to highp 4-component vector of float #4

Open
KurtLa opened this issue Dec 29, 2022 · 4 comments
Open

const float to highp 4-component vector of float #4

KurtLa opened this issue Dec 29, 2022 · 4 comments

Comments

@KurtLa
Copy link

KurtLa commented Dec 29, 2022

I have tried your ts branch but cannot figure out how to fix this error.

I get it for example with gasGiantRing.js and starPlanet.js.

#edit:
Same goes for the main branch.


Program Info Log: 

FRAGMENT

ERROR: 0:152: 'texture' : no matching overloaded function found 
ERROR: 0:152: 'assign' :  cannot convert from 'const float' to 'highp 4-component vector of float'
ERROR: 0:154: 'texture' : no matching overloaded function found 
ERROR: 0:154: 'assign' :  cannot convert from 'const float' to 'highp 4-component vector of float'

  147:             
  148:             // finally add colors
  149:             float posterized = floor(fbm2*4.0)/2.0;
  150:             vec4 col;
  151:             if (fbm2 < 0.625) {
> 152:                 col = texture(colorscheme, vec2(posterized, uv.y));
  153:             } else {
  154:                 col = texture(dark_colorscheme, vec2(posterized-1.0, uv.y));
  155:             }
  156: 
  157:             gl_FragColor = vec4(col.rgb, a * col.a);
  158:         }
THREE.WebGLProgram: Shader Error 1282 - VALIDATE_STATUS false

Program Info Log: 

FRAGMENT

ERROR: 0:123: 'texture' : no matching overloaded function found 
ERROR: 0:123: 'assign' :  cannot convert from 'const float' to 'highp 4-component vector of float'
ERROR: 0:125: 'texture' : no matching overloaded function found 
ERROR: 0:125: 'assign' :  cannot convert from 'const float' to 'highp 4-component vector of float'

  118:             
  119:             // apply some colors based on final value
  120:             float posterized = floor((ring+pow(light_d, 2.0)*2.0)*4.0)/4.0;
  121:             vec4 col;
  122:             if (posterized <= 1.0) {
> 123:                 col = texture(colorscheme, vec2(posterized, uv.y));
  124:             } else {
  125:                 col = texture(dark_colorscheme, vec2(posterized-1.0, uv.y));
  126:             }
  127:             float ring_a = step(0.28, ring);
  128: 
  129:             gl_FragColor = vec4(col.rgb, ring_a * col.a);```
@Timur310
Copy link
Owner

@KurtLa There is most probably a uniform type mismatch in the texture function, can you give me some more of what you tried in the ts branch? like what have you used in the ts branch if the files are .js.I'll try to get back as fast as possible in next week :)

@KurtLa
Copy link
Author

KurtLa commented Dec 29, 2022

@Timur310
yes sure.

I can reproduce it on all my computer.

npm install jsdom

in server-side-example.js add:

import { createGasGiantRing } from "./src/Planets/gasGiantRing.js";
import jsdom from "jsdom";

const { JSDOM } = jsdom;

global.document = new JSDOM(`<p></p>`, {
  includeNodeLocations: true,
}).window.document;

planetGroup.add(createGasGiantRing());

execute it with:
node server-side-example.js

#edit:
node v14.21.2

#edit2
same goes for the ts branch, but execute
npm install typescript
npx ts-node server-side-example.js

@KurtLa
Copy link
Author

KurtLa commented Feb 14, 2023

Hi @Timur310
were you able to reproduce my error?

@Timur310
Copy link
Owner

Hey @KurtLa sorry for the delayed response, I've been busy latelly with other works, but I'll try to reproduce it as soon as possible.Sorry for that again!

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

2 participants