Jump to content

Shader Experience : are you know this ?


NasimiAsl
 Share

Recommended Posts

because a float has to have a .
 

On 1/13/2018 at 11:12 PM, NasimiAsl said:

about variable 

when you use variable in shader code you most careful when you wanna use it  in mathematical formula

float a = 10;

position.x = -a  // return "a" value in some of android system

position.x = -1.0*a  // correct usage

float a = 10.;
position.x = -a;

should validate

Link to comment
Share on other sites

  • 2 months later...

some time that not have same result when A and B type is diffrent

A * B and B * A

we always look like both is variable in code but for math this is important who most used first

for example world is a mat4 and pos is a vec3

(  world  *  vec4(pos,1.)  ).xyz  
(  vec4(pos,1.)  *  world  ).xyz
 
look line 61 and 62 and look left and right side of separator

http://www.babylonjs-playground.com/#WPM24S#3

*notice look on sphere's

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...