|
AutoUV shaders [updated: 05/13/2020]
|
|
12-04-2015, 12:50 PM
Post: #23
|
||||
|
||||
|
RE: AutoUV shaders [updated: 10/29/2015]
Yeah, that is a nice shader (another in my list too.
)You jumped over one of my "tips". Check the console log: Quote:Trying OpenGL modesYou used '%' for the comment in the GLSL file - my tip you ignorede: "- you need to know a little of C language since GLSL language is very close to it;" Comments in C: - one line: // here come the one line comment - many lines: /* here come the block of lines to be commented */ Reading the message: - Info: Fragment: That inform where the error occurred: Fragment shader - the file with .fs extension; If you see Vertex, then you need to look into the Vertex shader file (.vs); - WARNING: 0:1: '%' : symbol not available in current GLSL version ERROR: 0:1: '%' : syntax error parse error That 0:1: for warning and/or error means the line number where you need to check the problem. If you see a typical Erlang message on the console, that means you probably need to look into the .auv file. ______ Those variable in the top that begin with uniform are parameters, so they come from somewhere. At that site the time must be a parameter made available by its API. In the code you can notice that time is used to define a rotation angle around Y. So, you can set your slider to allow you to select a value between 0.0-360.0 degrees (a more understandable value). This value must be converted to radians that is the correct value used with the trigonometric functions. you can add this const to the begin of the file (after the variable declarations): #define pi 3.14159265359; and, by considering you change the time variable name to angle (a more appropriated name), you can replace: vec3 ro = roty(vec3(3.),time*0.3); with: float a = angle/360.0 * 2.0*pi; vec3 ro = roty(vec3(3.),a);
|
||||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)




)
@MicheusVieira
MicheusVieira
Micheuss
micheus4wings3d