water shader 4 irrlicht nearly completed
water shader 4 irrlicht nearly completed
hello people
ive nearly made a water shader but i have one problem
in hlsl
how do u acesses time when in irrlicht
i mean in render monkey all u do is type this
time_0_X
to get the time
how do u do it in irrlicht
plz help
@m-nite
plz don t say this is irr elevent or has been answered
ive nearly made a water shader but i have one problem
in hlsl
how do u acesses time when in irrlicht
i mean in render monkey all u do is type this
time_0_X
to get the time
how do u do it in irrlicht
plz help
@m-nite
plz don t say this is irr elevent or has been answered
well I have no idea, but I was so excited by your post that I did have a quick look in the source engine's source, and found this in IMaterialRenderer.h
hope it helps
Code: Select all
virtual void setBasicRenderStates(const SMaterial& material,
const SMaterial& lastMaterial,
bool resetAllRenderstates) = 0;
//! Sets a constant for the vertex shader based on a name. This can be used if you used
//! a high level shader language like CG or HLSL to create a shader. Example: If you
//! created a shader which has variables named 'mWorldViewProj' (containing the
//! WorldViewProjection matrix) and another one named 'fTime' containing one float,
//! you can set them in your IShaderConstantSetCallBack derived class like this:
//! \code
//! virtual void OnSetConstants(video::IMaterialRendererServices* services)
//! {
//! video::IVideoDriver* driver = services->getVideoDriver();
//!
//! float time = (float)os::Timer::getTime()/100000.0f;
//! services->setVertexShaderConstant("fTime", &time, 1);
//!
//! core::matrix4 worldViewProj;
//! worldViewProj = driver->getTransform(video::ETS_PROJECTION);
//! worldViewProj *= driver->getTransform(video::ETS_VIEW);
//! worldViewProj *= driver->getTransform(video::ETS_WORLD);
//! services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
//! }
ok ill wiki it when its done
any way thanx for ur snippet it did all the work
@NIKO/SHADER EXPERTS
CAN HLSL LOAD TEXTURES FROM THE HLSL CODE?
or CAN IRRLICHT ASSIGN A TEXTURE TO A RESGITER?
oops caploack
thanx for ur support
the water looks to artificial since the wave pattern repeats so im gonna us a noise texture for random stuff (reason for above q)
any way thanx for ur snippet it did all the work
@NIKO/SHADER EXPERTS
CAN HLSL LOAD TEXTURES FROM THE HLSL CODE?
or CAN IRRLICHT ASSIGN A TEXTURE TO A RESGITER?
oops caploack
thanx for ur support
the water looks to artificial since the wave pattern repeats so im gonna us a noise texture for random stuff (reason for above q)