hgimg4¤Ë¤Æ¡¢¥ª¥Õ¥¹¥¯¥ê¡¼¥ó¥Ð¥Ã¥Õ¥¡¤òºîÀ®¤·¡¢¤½¤Î¥Ð¥Ã¥Õ¥¡¤Î¥Þ¥Æ¥ê¥¢¥ë¤òÄ̤¸¤Æ¥·¥§¡¼¥À¡¼¤ËÃͤòÁ÷¤ê¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¤¦¤Þ¤¯Á÷¤ì¤Ê¤¯¤Æº¤¤Ã¤Æ¤ª¤ê¤Þ¤¹¡£
¤¹¤ß¤Þ¤»¤ó¤¬¡¢¤´»ØƳ¤¤¤¿¤À¤±¤Þ¤»¤ó¤Ç¤·¤ç¤¦¤«¡£
°Ê²¼¡¢¤ï¤«¤ê¤ä¤¹¤¤¤Î¤Ç¡¢¾¡¼ê¤Ê¤¬¤é¡¢buhio¤µ¤ó¤ÎÇÈ¥·¥§¡¼¥À¡¼(https://hsp.tv/play/pforum.php?mode=all&num=99040)¤Ë¼ê¤ò²Ã¤¨¤¿¤â¤Î¤òÎã¤È¤·¤Æµó¤²¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£
¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
#include "hgimg4.as" ;hgimg4
screen 0,640,480
setcls CLSMODE_SOLID, $000000 ; ²èÌÌ¥¯¥ê¥¢ÀßÄê
gpreset
camera_fov=45:camera_aspect=1.5f:camera_near=0.5f:camera_far=768*10:camera_sw=0
gpcamera id_camera, camera_fov, camera_aspect, camera_near, camera_far,camera_sw ; ¥«¥á¥é¤È¤·¤ÆÀßÄꤹ¤ë
gpusecamera id_camera ; »ÈÍѤ¹¤ë¥«¥á¥é¤òÁªÂò¤¹¤ë
setpos id_camera,0,50,600
gplookat id_camera,0,0,0
buffer 1 , ginfo_sx ,ginfo_sy , screen_offscreen //¥ª¥Õ¥¹¥¯¥ê¡¼¥ó¥Ð¥Ã¥Õ¥¡ºîÀ®
gpgetmat bufmat , 1 ,GPGETMAT_OPT_SCRMAT //¥ª¥Õ¥¹¥¯¥ê¡¼¥ó¤Î¥Þ¥Æ¥ê¥¢¥ë¤ò¼èÆÀ
gpload id_model,"res/wave.gpb"//³Ê»Ò¤ËÇȤΥƥ¯¥¹¥Á¥ã¤òÄ¥¤Ã¤¿¥â¥Ç¥ë¤òÆɹþ
setscale id_model,5,5,5
gpnodeinfo id_mat,id_model, GPNODEINFO_MATERIAL,"obj1"//¥â¥Ç¥ë¤Î¥á¥Ã¥·¥å¤ËÂбþ¤¹¤ë¥Þ¥Æ¥ê¥¢¥ë
_time=0.0f
//--------------------------------------------------
*main
gsel 1
redraw 0
gpmatprm1 id_mat,"u_time",_time/2000 //<-------¤³¤Ã¤Á¤ÏÄ̾ïÄ̤ê
//gpmatprm1 bufmat,"u_time",_time/2000 //<-------¤³¤Ã¤Á¤â¾å¤ÈƱ¤¸·ë²Ì¤Ë¤Ê¤ë¤Ï¤º¤Ç¤Ï¡©¡©¡©
_time++
gpdraw ; 3DÉÁ²è¹¹¿·
gsel 0
pos 0,0
celput 1 , , 1.0 , 1.0
redraw 1
await 1000/60
goto *main
;//////////////////////////¤³¤³¤«¤é¥·¥§¡¼¥À¡¼
;textured.vert¤ò²þÊÑ¢ªtextured_wave.vert¤Ë̾Á°Êѹ¹
///////////////////////////////////////////////////////////
// Uniforms
uniform mat4 u_worldViewProjectionMatrix;
uniform float u_time;//¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ªÄɲùàÌÜ
¡¦¡¦¡¦¾Êά
void main()
{
vec4 position = getPosition();
position[1] += sin(position[0] + u_time* 100);//¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ª¢ªÄɲùàÌÜ
gl_Position = u_worldViewProjectionMatrix * position;
¡¦¡¦¡¦¾Êά