gamemaker 3d draw cubes in vertex buffer
Really Interesting, works similar a 3D cube on we can texture each side or with zoom-big object piece of work every bit a Skybox.
Some questions:
1.- The cube only appears inside the X/Y size of the sprite, if you brand it bigger looks cutted. I saw some shaders that on applied to a for example a 64x64 sprite in the runtime the outcome looks out that size. This is because a shader can piece of work out the sprite limitations in some way or considering on runtime the sprite limits goes big to fits the shader requeriments? Is to understand better how shaders works.
two.- The textures take some smoothing/mipmap/bilinear, is possible add an pick to switch that? to select Nearest or Bilinear, in instance we desire to preserve existent pixels?. In the aforementioned manner, the cube, talking about the polygon no have antialias, any chances to employ?
3.- Whatever way to Transform the model? I mean make the Ten,Y,Z more than bigger/brusk. For example scale the Y to use it as a column or as a edifice.
PD. Why the "Mario Cube" name?
The demo let me think of the program "prepakura" in reverse. keep up the good work!
Really Interesting, works similar a 3D cube on we tin texture each side or with zoom-big object work every bit a Skybox.
Some questions:
1.- The cube only appears within the X/Y size of the sprite, if you make it bigger looks cutted. I saw some shaders that on applied to a for example a 64x64 sprite in the runtime the upshot looks out that size. This is because a shader can piece of work out the sprite limitations in some manner or because on runtime the sprite limits goes large to fits the shader requeriments? Is to understand better how shaders works.
2.- The textures have some smoothing/mipmap/bilinear, is possible add together an option to switch that? to select Nearest or Bilinear, in example nosotros want to preserve real pixels?. In the aforementioned mode, the cube, talking most the polygon no have antialias, whatever chances to utilise?
3.- Any way to Transform the model? I mean make the Ten,Y,Z more bigger/short. For example scale the Y to utilise it as a cavalcade or as a building.
PD. Why the "Mario Cube" name?
1 - The sprite expanse is the Quad similar shadertoy uv screen or c2 vTex ;
2 - maybe in c3;
3 - calibration the sprite in editor ?
Mario cube ... really don't know
1- Understood
2- So actualy in C2 in that location is no way to utilise antialias to 3D render or use Nearest instead Bilinear?
3- I hateful scale the Cube rendered by the shader, to make more than tall, short or depth.
And then seems actually is non possible do what i want in this way. Really hope C3 comes with vertex shaders and the rest of options you lot need to unlock all the potential. Will be groovy have in C3 the chances to practice 2D games with the option to add together 3D things with some properties to adapt it as our needs.
i- Understood
ii- So actualy in C2 there is no way to apply antialias to 3D render or apply Nearest instead Bilinear? <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">
3- I mean calibration the Cube rendered by the shader, to make more tall, brusk or depth.
So seems actually is not possible practice what i want in this way. Really hope C3 comes with vertex shaders and the rest of options you lot need to unlock all the potential. Will be great have in C3 the chances to do 2D games with the pick to add together 3D things with some properties to adapt it as our needs.
matriax
glmatrix 2.0 will resolve the trouble...
I made some other case based on box mapped with specular not based on triangles vertices;
http://gigatron3k.free.fr/html5/C2/FX/mcube2
And here is the fx;
http://gigatron3k.free.fr/html5/C2/FX/mcube2.rar
You lot tin calibration but the box on x y z and run into mapped texure wich scaled with static value;
this mean all faces are scaled separately the box; however if you want make edifice Set the x, y or z face scale to the minimum instead of maximum, and zoom it : in this demo the size of sprite is 450x450;
texture disposition format must exactly like this; i used this texure in demo;
https://en.wikipedia.org/wiki/File:Skybox_example.png
practiced luck ;
Howdy Gigatron , kickoff of all thanks for the plugin!.
Looks promising, but i realized some problem with the photographic camera, hither is a twitter post with a video i made:
https://twitter.com/DavitMasia/status/8 ... 3825052676
Without the ScrollTo is more evident that the cube is "floating".
Is there anyway to modify how the camera works? I mean, is there anyway to change the X,Z,Y position of the camera? Also rotate the X,Y,Z of the camera. This will bring a lot more options.
I know you said you will await to C3 for develop more shaders, mayhap in C3 there will need some edits or do since 0 again and so simply asking if tin be washed in a piece of cake manner, otherwise not worry simply a few weeks to the C3 beta so no problem.
I recollect with some tweaks a shader similar this tin be used to do topDown shooters, Platforms or real 3D games similar Doom or Wolf3D in a easy way that tin can exist crawly.
P.D. Also discovered that turn Sampling to "Bespeak" instead "Linear" prove real pixels with no antialias or texture smoothing that is great for some retro games.
----
Edit 1: I fabricated a stress test with this results:
In a GeForce 670 GTX With 150 sprites at 256x256 pixels using 1024x texture and one light for each cube starts to break <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">
https://twitter.com/DavitMasia/condition/8 ... 0237495296
The game drops at 50 but nonetheless runs well, but the recording goes crazy and gots freezed XD . No matter if the cubes are rotating or not, or if the textures have smooth sampling or not the perfomance is the same. The problems is the number of sprites and their size, then the perfomance drops considerably <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> . BTW, i guess still there is no optimization and mayhap also the use of 1 lite for each cube instead one for all can affect to that and tin can be improved a lot.
Edit two: Editing the shader
I removed the lite (Spec and spow parameters) and not gain all the perfomance as i idea. Without lite the number of cubes before frame downs increases to fifteen more but is not the big thing. So i guess is the mathematical stuff that i non empathise. Btw, i'm going to try editing things and doing tests for marvel <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">
Perfomance tests:
Shader Perfomance tests before frame drops in cubes on screen:
64x = 1600
256x = 160
512x = 60
I found something weird. Cubes without movementin the screen static, simply placing the shader and the same perfomance. If the shader no changes their position and the cube is not rotating decreases the frame drops. And so i approximate the actual shader render always that he cans even if in that location is no information-change.
Doing another mail considering the other one was already too big.
I go on doing more than examination and i found some weird thing that improves the perfomance a lot lossing some blastoff in the cube borders ¿? .
[quote:2pmop7cr]
// The perfomance problem?
float trace(vec3 o, vec3 r)
{
float t = 0.0; //
// Some kind of weird blastoff around the cube ¿?
for (int i = 0; i < 64 ; ++i) { // 64 = 150cubes | 32 = 300 cubes | 16 = 450 cubes on screen (256x Sprites)
vec3 p = o + r * t;
float d = map(p).x;
t += d;
}
return t;
}
With 64 the cube looks correct without any blastoff loss effectually there. With less, the perfomance is improved a lot but with that weird thing.
Why this thing? Is similar each 3D cube is formed overlapping 64 alpha renders :O . Why not create the cube using merely quad/triangles polygons? Or i'm missing something ¿? .
matriax
This shader using iterations for the precision (raymarching shader); You must demand minimum 64 iterations
this is normal value, imagine some shaders accept 200 iterations...
If you desire gain a chip speed , you lot tin break the loop if precision go lower than 0.001; the ray because
zip to hit;
// The perfomance problem?
float trace(vec3 o, vec3 r)
{
bladder t = 0.0; //
// Some kind of weird alpha around the cube ¿?
for (int i = 0; i < 64; ++i) { // 64 = 150cubes | 32 = 300 cubes | 16 = 450 cubes on screen (256x Sprites)
vec3 p = o + r * t;
float d = map(p).x;
if (d<0.001) break; //This volition finish the loop ... and consider that the ray has nothing more than to notice
t += d;
}
return t;
}
The first shader demo utilize triangles : http://gigatron3k.free.fr/html5/C2/FX/mcube
instead of raymarching like here ;
Gigatron Not a real proceeds. Between the same or 10 more cubes on screen with dissimilar tests.
Also i establish another perfomance affair. If the sprite is 512x512 but the cube with their zoom is simply for example 64x64 size their perfomance in screen is the same with the cube at 512x512 or 32x32 or whatever :S . The perfomance simply improves with the size of the sprite not the shader render content. Maybe was apparently merely i didn't know that.
So, what is the real difference between Raymarching and using triangles in terms of quality or features? Because after know how raymarching works seems is a GPU consuming :S .
Tin can y'all post the kickoff Cube shader that uses triangles please? I want to test their perfomance to see how much divergence is.
---
Interesting shaders i establish that may amend the perfomance:
-----------------------------------------------------
Triangle Rasterize shader with a cube textured:
https://world wide web.shadertoy.com/view/XdlGzn
----------------------------------------------------
Cheap Cubemap:
https://www.shadertoy.com/view/ltl3D8
Gigatron Perfomance tests comparing Rasterize-RayMarching
Number of sprites at 256x before frame downs
Raymarching = 150
Rasterize = 320
Number of sprites at 512x before frame downs
Raymarching = 60
Rasterize = 120
Number of sprites at 1024x before frame downs
Raymarching = 25-30
Rasterize = 60
Mmm... this is correct? I thought with rasterize the perfomance will exist boosted, yes there is plain an improvement simply i was expecting more than 1000 cubes for 256x :S . But at the cease the perfomance was "just" 2x.
I'm going to see the .FX code and do other test to see if i can find in this example what is the thing more GPU is taken.
matriax
Don't forget this : every sprite you created hateful X sprite on the execution with C2. Each Sprite are used to draw glsl shader inside;
Are you tryed operation with empty square sprites on C2 without fx ?
Hope y'all empathize .
Gigatron Nope, tried now, i did it and this are the results:
Number of sprites before frame downs
512x512 = +1900 sprites(no FX) | 120 With Rasterize FX Cube
1024x1024 = 800-900 Sprites(no FX) | 60 With Rasterize FX Cube
What you think?
Also i saw the .FX code and damn, how complicated is do a simple cube with a texture :Southward .
matriax
glsl texture3D ... or textureCube is missing in glmatrix 1.30 used by C2 ; perchance C3
johnsonyesseresels.blogspot.com
Source: https://www.construct.net/en/forum/construct-2/effects-31/effect-mario-cube-fx-122883
0 Response to "gamemaker 3d draw cubes in vertex buffer"
Yorum Gönder