Jump to content

ParaToxic

Members
  • Posts

    425
  • Joined

  • Last visited

Posts posted by ParaToxic

  1. Hey,I think there isn't a shader for that stuff here,but I can tell you how to assign a shader to a mesh:

     

    First load a mesh (without materials)

    TEntity mesh = LoadMesh("");
    

     

    Then you load a material with your shader and assign it:

    MAT File:
    texture0="abstract::blah.dds"
    shader="abstract::your_shader.vert","abstract::your_shader.frag"
    LOAD:
    TMaterial mat = LoadMaterial("abstract::mymaterial.mat");
    PaintEntity(mesh,mat);
    

     

    And get the Shader from the material for adjusting:

     

    TShader shader = GetMaterialShader(mat);
    SetShaderFloat(shader,"myuniformvariable",0.0f);
    //or
    void SetShaderFloat(TShader shader, str uniform, float x )
    void SetShaderFloatArray(TShader shader, str name, flt* ar, int count=1)
    void SetShaderVec2(TShader shader, str uniform, TVec2 v )
    void SetShaderVec3(TShader shader, str uniform, TVec3 v )
    void SetShaderVec4(TShader shader, str uniform, TVec4 v )
    void SetShaderInt(TShader shader, str uniform, int i )
    void SetShaderIntArray(TShader shader, str name, int* ar, int count=1)
    void SetShaderMat3(TShader shader, str uniform, mat3 mat )
    void SetShaderMat4(TShader shader, str uniform, mat4 mat )
    

     

    I hope it helps a little bit ;)

  2. So there isn't a way to make a macro or something like that and add it allways to the values to have a speed based effect ?

    The 2 lines above makes that the weapon going to be draged when the player going to be draged,but divided with 2000 and 800 for a little moving effect.

  3. Thanks ,but things like :

    _slotManager->_weaponSlot[_slotManager->i_currentSlot]->_currentWeapon->VC3_rotationsmooth.X += VC3_drag.X/3000.0f / AppSpeed();
    _slotManager->_weaponSlot[_slotManager->i_currentSlot]->_currentWeapon->VC3_rotationsmooth.Y += -VC3_drag.Y/800.0f / AppSpeed();
    

     

    ???? is that right?

  4. Hey ya,

    I have a question about the functions AppSpeed() and AppTime().So I use right now the AppSpeed() command to make some effects time or speed based ,so it runs with 190 FPS and with 60 equal,but it doesn't.

    For example I have this line of code:

    weapon->VC3_rotationsmooth.Z = Curve(-0.05 * AppSpeed(),weapon->VC3_rotationsmooth.Z,5.0);
    

     

    It is a simple Effect function for recoil of the weapon.So I had with 190 FPS the value Curve(-0.06....) and everything worked fine,but then I set the Vsync mode and it was only sh**.

    The version with * AppSpeed() don't work well ,because it's not equal with 190 FPS , 60 FPS or 40 FPS,so what to do?

     

    Is there a way to adjust all values with 60 FPS,so that AppSpeed is 1.0 ,and have the same result at 190 FPs or 40 FPs etc.??

     

    Thank you

  5. When you want to make the explosion bigger or smaller in the diameter you have to change the SetEmitterVelocity(Vec3(0,0,0),Vec3(1,1,1)) and (optional) the waver value

     

    For Example:

    Big Explosion:
    SetEmitterWaver(emitter,50.0);
    SetEmitterVelocity(Vec3(0,1,0),Vec3(5,0,5)) //When the particles moves very fast you need more particles otherwise the distance between the particles are too big and it looks bad
    Small Explosion:
    SetEmitterWaver(emitter,5.0);
    SetEmitterVelocity(emitter,Vec3(0,1,0),Vec3(1,0,1));
    

    • Upvote 1
  6. Hey ya,

    I would ask you if there is a way to do some OpenGL drawing multithreaded ,for example for loading screens ,when the models and textures are loaded ,I can't play a smoothly loading animation,so it would be a good idea to do that in an onther thread.

    So can I do multithreading with the openGL context?

    Would be nice to hear something :o

  7. First one question is ,why you write "aLabel::TextPosition" and not only "TextPosition..." .Is the enum inside a class?

    All is right only the line "case aLabel::TextPosition.Center:" is wrong.You have to write in both cases the following:

    #include "aLabel.h"
    aLabel::aLabel(void)
    {
    textPosition = aLabel::TextPosition::Center;
    }
    

    and

    case aLabel::TextPosition::Center:
    

     

    Only a little mistake :)

    • Upvote 1
  8. I can't see why you can't use usual LE2-emitter for creating sparks effect.

    Because when I use a spark texture ,which have the size of 64x256 pixels it turns allways in an other direction.I don't know how to fix that..:)

  9. Hey I would ask you if I can set the rotation of the sprites or particles emitted by a emitter?

    I see that the rotation of the sprites are random and you can't create something like sparks flying away from the position of the emitter like a firework.

     

    Is there a way to set the rotation ?

     

    Thanks

  10. One option is to cut the whole texture to frames and put it into a pak(optional but make sense for smaller file) and make a class with the ,I don't know lets say 24 textures, as an array and make it like for a animation with a frame value ( caus you need a integer for the frame when you write texture[frame] ,use the AppTime function like this:

    if(AppTime() > timer)
    {
    frame++;
    timer = AppTime() + /* now the delay in millisecs*/ 100;
    }
    

     

    The second option is to make a kind of grid and a second buffer.The you render the actuall textureframe to the buffer with the given gridpoint for the x,y like DrawImage(t_explosion,X,Y,256,-256); .So you make a kind of cameraspot for the individual frames.

  11. For better performance you could use the zlib library to compress the textures and decompress them later.(The server has a kind of cache folder with the compressed new textures and the client only download them and decompress (decompressing with zlib is very fast.I had around 30MB/s)

  12. Hey I want to learn lua for scripting objects in the Editor.Now I want to turn a child of a model in the script ,but I become an error when I save it.

     

    Here my try :)

    require("scripts/class")
    local class=CreateClass(...)
    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    
    object.outer = self.model:FindChild("Outer") -- here I become an error
    
    
    end
    

  13. I use the shader ,but it is a SSAO shader,which makes corners a little bit darker like in the real world.It think the problem is that the cinema4D phong tag is a kind of deformer and will not be saved in the FBX or the other formats.

     

    @saboteur:

    can I send you a model with the phong problem and you convert it in UU3D like you made with you models ,because I haven't UU3D and when it works well I will buy it.Would be nice biggrin.png

    test.zip

×
×
  • Create New...