Jump to content

Snowflakes are squares.


Prometheus

Recommended Posts

I'm toying around with the precipitation datablock and created my own for snowflakes. Things have gone smoothly except the snowflakes themselves are squares instead of circles.


http://i.imgur.com/bVKwSDm.png


The datablock code:

 

datablock PrecipitationData(LightSnow)
{
  soundProfile = "LightSnowSound";

  dropTexture = "art/environment/precipitation/snowflake2";
  splashTexture = "art/environment/precipitation/water_splash";
  dropSize = 0.35;
  splashSize = 0.1;
  useTrueBillboards = false;
  splashMS = 500;
};

 

snowflake2.dml simply contains:

 

snowflake2

 

The snowflake image itself (128x128 png)


http://i.imgur.com/21mM0SX.png


Any suggestions?

Link to comment
Share on other sites

I also had the same problem, I suggest to use your own shader for that:

you can specify which shader to use for the drops and splashes as you can see here https://github.com/GarageGames/Torque3D/blob/2044b2691e1a29fa65d1bdd163f0d834995433ce/Engine/source/T3D/fx/precipitation.cpp#L1633


To do that, add this to a .cs file (for instance, core/scripts/client/shaders.cs)

new ShaderData( fxPrecipitationShader )
{
   DXVertexShaderFile 	= "shaders/common/precipV.hlsl";
   DXPixelShaderFile 	= "shaders/common/precipP.hlsl";
 
   OGLVertexShaderFile  = "shaders/common/gl/precipV.glsl";
   OGLPixelShaderFile   = "shaders/common/gl/precipP.glsl";
 
   samplerNames[0] = "$diffuseMap";
   samplerNames[1] = "$alphaMap";
 
   pixVersion = 1.4;
};

 

then in your precipitation datablock add these two fields:

 

dropShader = fxPrecipitationShader;
splashShader = fxPrecipitationShader;

 

if you are still unhappy with the result, you can tweak the shader or make a new one, just replace the DXVertexShaderFile and the other ones with your tweaked/new shader.



NOTE:


Keep in mind that your texture is not in tiles as it is supposed to be by default...

Check here: https://github.com/GarageGames/Torque3D/blob/2044b2691e1a29fa65d1bdd163f0d834995433ce/Engine/source/T3D/fx/precipitation.cpp#L159

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.

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.

×
×
  • Create New...