Timeline for Using shader for cubes
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 27, 2015 at 20:14 | vote | accept | dimitris93 | ||
| Jan 25, 2015 at 14:45 | comment | added | dimitris93 | yes ! i thought the same thing 1 min ago. thats soo much easier you are right... | |
| Jan 25, 2015 at 14:44 | comment | added | Peethor | Oh no, don't code it. Download a program like blender, and create the model in that. All you have to do in code is load the model you made, and draw it like you're drawing the model you have now. | |
| Jan 25, 2015 at 13:25 | comment | added | dimitris93 | can you give me a code example of filleted edges ? i can kind of understand what you mean in theory, but my problem is coding it | |
| Jan 25, 2015 at 12:09 | comment | added | Peethor | Like i said in my previous comment, you can achieve the foggy corners by making 3d models of cubes with filleted edges. I think they did that in the example as well. As for the top-down fade, if you make the faces of those models slightly curved, you can get that effect. But it works best if the light doesnt shine directly at the face, but comes from below. To make all bricks get the same light, you need to call cubeeffect.directionallight0.specularpower = 0;. I thought the default was 0, but apperantly not. | |
| Jan 25, 2015 at 11:03 | comment | added | dimitris93 | hmm with this code i do have the same lightning in every cube with Vector3( 0, 0, -1), but what about the top-down lightning i mentioned in my question, or the "foggy edges" any idea about those ? (the Vector3( 0, 1, -1) gives a different color on each cube) | |
| Jan 25, 2015 at 10:59 | comment | added | Peethor | Do note, however, that this only makes all cubes uniformly lit. You could get that fade by messing with the normals. You could, for example, make cubes with actual round edges (will take a few more polygons), and curve the sides a little bit, as if you're inflating the cube. | |
| Jan 25, 2015 at 10:55 | history | edited | Peethor | CC BY-SA 3.0 | added 70 characters in body |
| Jan 25, 2015 at 10:54 | comment | added | Peethor | Oops sorry, I'll edit my answer to include the direction. But it depends on your axes. If you have Y up, x to the right, you would want something like new vector3(0,1,-1) | |
| Jan 25, 2015 at 10:50 | comment | added | dimitris93 | what direction should my color have ? right now all i get is a solid red color (no shades anywhere) | |
| Jan 25, 2015 at 10:47 | history | answered | Peethor | CC BY-SA 3.0 |